You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Yury Kudryashov (JIRA)" <ji...@codehaus.org> on 2009/04/20 09:53:44 UTC

[jira] Created: (MANTTASKS-143) Maven-ant-task cannot connect to HTTPS repository with authorization

Maven-ant-task cannot connect to HTTPS repository with authorization
--------------------------------------------------------------------

                 Key: MANTTASKS-143
                 URL: http://jira.codehaus.org/browse/MANTTASKS-143
             Project: Maven 2.x Ant Tasks
          Issue Type: Bug
          Components: dependencies task
    Affects Versions: 2.0.9
         Environment: Windows Vista, Java 1.6.11.
            Reporter: Yury Kudryashov


I have an internal Maven repository that can only be accessed via HTTPS with authorization. I have setup everything in settings.xml and have the correct .jks file to access the repository. 

My goal is to download dependencies from that repository.

Command "mvn -Djavax.net.ssl.trustStore=my.jks package" runs ok - dependency is retrieved. But if I try to use maven-ant-tasks and retrieve dependencies from ant - I got the "missing artifact" errors. 

Here's part of my ant script that does the copying: 

<artifact:pom id="main.project" file="pom.xml"/>
<artifact:remoteRepository id="rep" url="${repository}"/>

<artifact:dependencies  pathId="dependency.classpath"
                        filesetId="dependency.fileset"
                        versionsId="dependency.versions">
    <pom refid="main.project"/>
    <remoteRepository refid="rep"/>
</artifact:dependencies>

<copy todir=".">
      <fileset refid="dependency.fileset" />
     <mapper classpathref="maven-ant-tasks.classpath"
                 classname="org.apache.maven.artifact.ant.VersionMapper"
                 from="${dependency.versions}" to="flatten" />
</copy>

I run ant as:
ant -Djavax.net.ssl.trustStore=my.jks

And here's what I'm getting:

[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies]  Diagnosis:
[artifact:dependencies]
[artifact:dependencies] Unable to resolve artifact: Missing:

I ran procmon and it seems that maven-ant-tasks doesn't attempt to use the .jks to access the repository over HTTPS. 

The pom is pretty simple and just includes a single dependency.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MANTTASKS-143) Maven-ant-task cannot connect to HTTPS repository with authorization

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANTTASKS-143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated MANTTASKS-143:
------------------------------------

    Description: 
I have an internal Maven repository that can only be accessed via HTTPS with authorization. I have setup everything in settings.xml and have the correct .jks file to access the repository. 

My goal is to download dependencies from that repository.

Command "mvn -Djavax.net.ssl.trustStore=my.jks package" runs ok - dependency is retrieved. But if I try to use maven-ant-tasks and retrieve dependencies from ant - I got the "missing artifact" errors. 

Here's part of my ant script that does the copying: 
{code:xml}
<artifact:pom id="main.project" file="pom.xml"/>
<artifact:remoteRepository id="rep" url="${repository}"/>

<artifact:dependencies  pathId="dependency.classpath"
                        filesetId="dependency.fileset"
                        versionsId="dependency.versions">
    <pom refid="main.project"/>
    <remoteRepository refid="rep"/>
</artifact:dependencies>

<copy todir=".">
      <fileset refid="dependency.fileset" />
     <mapper classpathref="maven-ant-tasks.classpath"
                 classname="org.apache.maven.artifact.ant.VersionMapper"
                 from="${dependency.versions}" to="flatten" />
</copy>
{code}
I run ant as:
{noformat}ant -Djavax.net.ssl.trustStore=my.jks{noformat}

And here's what I'm getting:
{noformat}
[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies]  Diagnosis:
[artifact:dependencies]
[artifact:dependencies] Unable to resolve artifact: Missing:
{noformat}
I ran procmon and it seems that maven-ant-tasks doesn't attempt to use the .jks to access the repository over HTTPS. 

The pom is pretty simple and just includes a single dependency.

  was:
I have an internal Maven repository that can only be accessed via HTTPS with authorization. I have setup everything in settings.xml and have the correct .jks file to access the repository. 

My goal is to download dependencies from that repository.

Command "mvn -Djavax.net.ssl.trustStore=my.jks package" runs ok - dependency is retrieved. But if I try to use maven-ant-tasks and retrieve dependencies from ant - I got the "missing artifact" errors. 

Here's part of my ant script that does the copying: 

<artifact:pom id="main.project" file="pom.xml"/>
<artifact:remoteRepository id="rep" url="${repository}"/>

<artifact:dependencies  pathId="dependency.classpath"
                        filesetId="dependency.fileset"
                        versionsId="dependency.versions">
    <pom refid="main.project"/>
    <remoteRepository refid="rep"/>
</artifact:dependencies>

<copy todir=".">
      <fileset refid="dependency.fileset" />
     <mapper classpathref="maven-ant-tasks.classpath"
                 classname="org.apache.maven.artifact.ant.VersionMapper"
                 from="${dependency.versions}" to="flatten" />
</copy>

I run ant as:
ant -Djavax.net.ssl.trustStore=my.jks

And here's what I'm getting:

[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies]  Diagnosis:
[artifact:dependencies]
[artifact:dependencies] Unable to resolve artifact: Missing:

I ran procmon and it seems that maven-ant-tasks doesn't attempt to use the .jks to access the repository over HTTPS. 

The pom is pretty simple and just includes a single dependency.


> Maven-ant-task cannot connect to HTTPS repository with authorization
> --------------------------------------------------------------------
>
>                 Key: MANTTASKS-143
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-143
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: dependencies task
>    Affects Versions: 2.0.9
>         Environment: Windows Vista, Java 1.6.11.
>            Reporter: Yury Kudryashov
>
> I have an internal Maven repository that can only be accessed via HTTPS with authorization. I have setup everything in settings.xml and have the correct .jks file to access the repository. 
> My goal is to download dependencies from that repository.
> Command "mvn -Djavax.net.ssl.trustStore=my.jks package" runs ok - dependency is retrieved. But if I try to use maven-ant-tasks and retrieve dependencies from ant - I got the "missing artifact" errors. 
> Here's part of my ant script that does the copying: 
> {code:xml}
> <artifact:pom id="main.project" file="pom.xml"/>
> <artifact:remoteRepository id="rep" url="${repository}"/>
> <artifact:dependencies  pathId="dependency.classpath"
>                         filesetId="dependency.fileset"
>                         versionsId="dependency.versions">
>     <pom refid="main.project"/>
>     <remoteRepository refid="rep"/>
> </artifact:dependencies>
> <copy todir=".">
>       <fileset refid="dependency.fileset" />
>      <mapper classpathref="maven-ant-tasks.classpath"
>                  classname="org.apache.maven.artifact.ant.VersionMapper"
>                  from="${dependency.versions}" to="flatten" />
> </copy>
> {code}
> I run ant as:
> {noformat}ant -Djavax.net.ssl.trustStore=my.jks{noformat}
> And here's what I'm getting:
> {noformat}
> [artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
> [artifact:dependencies]  Diagnosis:
> [artifact:dependencies]
> [artifact:dependencies] Unable to resolve artifact: Missing:
> {noformat}
> I ran procmon and it seems that maven-ant-tasks doesn't attempt to use the .jks to access the repository over HTTPS. 
> The pom is pretty simple and just includes a single dependency.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MANTTASKS-143) Maven-ant-task cannot connect to HTTPS repository with authorization

Posted by "Carl Meister (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MANTTASKS-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=294041#comment-294041 ] 

Carl Meister edited comment on MANTTASKS-143 at 3/13/12 2:28 PM:
-----------------------------------------------------------------

This might be part of the general problem where the dependencies task doesn't apply authentication info from the settings.xml file if the remoteRepository elements in the task are refids rather than defined inline.  The culprit seems to be the {{updateRepositoryWithSettings()}} method in AbstractArtifactTask.java, which reads the auth information but then sets it on the ref RemoteRepository instance rather than the canonical instance.  Since the get() methods all delegate to the canonical instance, the auth info is effectively lost.  This could be patched by putting 
{{repository = (RemoteRepository) repository.getInstance();}}
at the top of the method, or the patch proposed in MANTTASKS-175 to load auth during settings initialization also seems to work.
                
      was (Author: cmeister):
    This is part of a general problem where the dependencies task doesn't apply authentication info from the settings.xml file if the remoteRepository elements in the task are refids rather than defined inline.  The culprit seems to be the {{updateRepositoryWithSettings()}} method in AbstractArtifactTask.java, which reads the auth information but then sets it on the ref RemoteRepository instance rather than the canonical instance.  Since the get() methods all delegate to the canonical instance, the auth info is effectively lost.  This could be patched by putting 
{{repository = (RemoteRepository) repository.getInstance();}}
at the top of the method, or the patch proposed in MANTTASKS-175 to load auth during settings initialization also seems to work.
                  
> Maven-ant-task cannot connect to HTTPS repository with authorization
> --------------------------------------------------------------------
>
>                 Key: MANTTASKS-143
>                 URL: https://jira.codehaus.org/browse/MANTTASKS-143
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: dependencies task
>    Affects Versions: 2.0.9
>         Environment: Windows Vista, Java 1.6.11.
>            Reporter: Yury Kudryashov
>
> I have an internal Maven repository that can only be accessed via HTTPS with authorization. I have setup everything in settings.xml and have the correct .jks file to access the repository. 
> My goal is to download dependencies from that repository.
> Command "mvn -Djavax.net.ssl.trustStore=my.jks package" runs ok - dependency is retrieved. But if I try to use maven-ant-tasks and retrieve dependencies from ant - I got the "missing artifact" errors. 
> Here's part of my ant script that does the copying: 
> {code:xml}
> <artifact:pom id="main.project" file="pom.xml"/>
> <artifact:remoteRepository id="rep" url="${repository}"/>
> <artifact:dependencies  pathId="dependency.classpath"
>                         filesetId="dependency.fileset"
>                         versionsId="dependency.versions">
>     <pom refid="main.project"/>
>     <remoteRepository refid="rep"/>
> </artifact:dependencies>
> <copy todir=".">
>       <fileset refid="dependency.fileset" />
>      <mapper classpathref="maven-ant-tasks.classpath"
>                  classname="org.apache.maven.artifact.ant.VersionMapper"
>                  from="${dependency.versions}" to="flatten" />
> </copy>
> {code}
> I run ant as:
> {noformat}ant -Djavax.net.ssl.trustStore=my.jks{noformat}
> And here's what I'm getting:
> {noformat}
> [artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
> [artifact:dependencies]  Diagnosis:
> [artifact:dependencies]
> [artifact:dependencies] Unable to resolve artifact: Missing:
> {noformat}
> I ran procmon and it seems that maven-ant-tasks doesn't attempt to use the .jks to access the repository over HTTPS. 
> The pom is pretty simple and just includes a single dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANTTASKS-143) Maven-ant-task cannot connect to HTTPS repository with authorization

Posted by "Jochen Stiepel (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTTASKS-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=228086#action_228086 ] 

Jochen Stiepel commented on MANTTASKS-143:
------------------------------------------

I'm using also https with authorization, but for us it works!

We are setting the environment variable e.g.:
ANT_OPTS="-Djavax.net.ssl.trustStore=my.jks -Djavax.net.ssl.trustStorePassword=changeit"

You should be able to see the connect in your maven repo (e.g. Artifactory show's it in the logs.)

 

> Maven-ant-task cannot connect to HTTPS repository with authorization
> --------------------------------------------------------------------
>
>                 Key: MANTTASKS-143
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-143
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: dependencies task
>    Affects Versions: 2.0.9
>         Environment: Windows Vista, Java 1.6.11.
>            Reporter: Yury Kudryashov
>
> I have an internal Maven repository that can only be accessed via HTTPS with authorization. I have setup everything in settings.xml and have the correct .jks file to access the repository. 
> My goal is to download dependencies from that repository.
> Command "mvn -Djavax.net.ssl.trustStore=my.jks package" runs ok - dependency is retrieved. But if I try to use maven-ant-tasks and retrieve dependencies from ant - I got the "missing artifact" errors. 
> Here's part of my ant script that does the copying: 
> <artifact:pom id="main.project" file="pom.xml"/>
> <artifact:remoteRepository id="rep" url="${repository}"/>
> <artifact:dependencies  pathId="dependency.classpath"
>                         filesetId="dependency.fileset"
>                         versionsId="dependency.versions">
>     <pom refid="main.project"/>
>     <remoteRepository refid="rep"/>
> </artifact:dependencies>
> <copy todir=".">
>       <fileset refid="dependency.fileset" />
>      <mapper classpathref="maven-ant-tasks.classpath"
>                  classname="org.apache.maven.artifact.ant.VersionMapper"
>                  from="${dependency.versions}" to="flatten" />
> </copy>
> I run ant as:
> ant -Djavax.net.ssl.trustStore=my.jks
> And here's what I'm getting:
> [artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
> [artifact:dependencies]  Diagnosis:
> [artifact:dependencies]
> [artifact:dependencies] Unable to resolve artifact: Missing:
> I ran procmon and it seems that maven-ant-tasks doesn't attempt to use the .jks to access the repository over HTTPS. 
> The pom is pretty simple and just includes a single dependency.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MANTTASKS-143) Maven-ant-task cannot connect to HTTPS repository with authorization

Posted by "Carl Meister (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MANTTASKS-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=294041#comment-294041 ] 

Carl Meister commented on MANTTASKS-143:
----------------------------------------

This is part of a general problem where the dependencies task doesn't apply authentication info from the settings.xml file if the remoteRepository elements in the task are refids rather than defined inline.  The culprit seems to be the {{updateRepositoryWithSettings()}} method in AbstractArtifactTask.java, which reads the auth information but then sets it on the ref RemoteRepository instance rather than the canonical instance.  Since the get() methods all delegate to the canonical instance, the auth info is effectively lost.  This could be patched by putting 
{{repository = (RemoteRepository) repository.getInstance();}}
at the top of the method, or the patch proposed in MANTTASKS-175 to load auth during settings initialization also seems to work.
                
> Maven-ant-task cannot connect to HTTPS repository with authorization
> --------------------------------------------------------------------
>
>                 Key: MANTTASKS-143
>                 URL: https://jira.codehaus.org/browse/MANTTASKS-143
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: dependencies task
>    Affects Versions: 2.0.9
>         Environment: Windows Vista, Java 1.6.11.
>            Reporter: Yury Kudryashov
>
> I have an internal Maven repository that can only be accessed via HTTPS with authorization. I have setup everything in settings.xml and have the correct .jks file to access the repository. 
> My goal is to download dependencies from that repository.
> Command "mvn -Djavax.net.ssl.trustStore=my.jks package" runs ok - dependency is retrieved. But if I try to use maven-ant-tasks and retrieve dependencies from ant - I got the "missing artifact" errors. 
> Here's part of my ant script that does the copying: 
> {code:xml}
> <artifact:pom id="main.project" file="pom.xml"/>
> <artifact:remoteRepository id="rep" url="${repository}"/>
> <artifact:dependencies  pathId="dependency.classpath"
>                         filesetId="dependency.fileset"
>                         versionsId="dependency.versions">
>     <pom refid="main.project"/>
>     <remoteRepository refid="rep"/>
> </artifact:dependencies>
> <copy todir=".">
>       <fileset refid="dependency.fileset" />
>      <mapper classpathref="maven-ant-tasks.classpath"
>                  classname="org.apache.maven.artifact.ant.VersionMapper"
>                  from="${dependency.versions}" to="flatten" />
> </copy>
> {code}
> I run ant as:
> {noformat}ant -Djavax.net.ssl.trustStore=my.jks{noformat}
> And here's what I'm getting:
> {noformat}
> [artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
> [artifact:dependencies]  Diagnosis:
> [artifact:dependencies]
> [artifact:dependencies] Unable to resolve artifact: Missing:
> {noformat}
> I ran procmon and it seems that maven-ant-tasks doesn't attempt to use the .jks to access the repository over HTTPS. 
> The pom is pretty simple and just includes a single dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira