Maven
  1. Maven
  2. MNG-4469

[regression] deploy:deploy-file fails with secured repository

    Details

    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      deploy:deploy-file or any other mojo that creates artifact repositories on its own will appear to ignore mirror, proxy and authentication infos from the settings when run with Maven 3.0. This is due to the ArtifactRepositoryFactory and the WagonManager being stateless and not injecting these infos any longer automatically.

        Issue Links

          Activity

          Benjamin Bentmann made changes -
          Field Original Value New Value
          Link This issue is duplicated by MNG-4478 [ MNG-4478 ]
          Hide
          Benjamin Bentmann added a comment -

          Fixed in r888488.

          Show
          Benjamin Bentmann added a comment - Fixed in r888488 .
          Benjamin Bentmann made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Assignee Benjamin Bentmann [ bentmann ]
          Resolution Fixed [ 1 ]
          Fix Version/s 3.0-alpha-6 [ 15996 ]
          Hide
          Stephan Weber added a comment - - edited

          just tried the new version of maven 3 alpha 6

          mvn eclipse:to-maven -DdeployTo=man-uploads::default::http://localhost:8081/nexus/content/repositories/man-uploads -DeclipseDir="C:\eclipse350"

          still does only work if nexus security is switched off

          Show
          Stephan Weber added a comment - - edited just tried the new version of maven 3 alpha 6 mvn eclipse:to-maven -DdeployTo=man-uploads::default:: http://localhost:8081/nexus/content/repositories/man-uploads -DeclipseDir="C:\eclipse350" still does only work if nexus security is switched off
          Benjamin Bentmann made changes -
          Link This issue relates to MINVOKER-99 [ MINVOKER-99 ]
          Hide
          Anders Hammar added a comment -

          I can confirm that a deploy with altDeploymentRepository doesn't not work with auth in Maven 3.0-alpha-6. It does work with Maven 2.2.1 though.

          Here my command:
          mvn deploy -DaltDeploymentRepository=repo-xxx::default::http://repo-xxx/content/repositories/releases

          A server with id 'repo-xxx' is defined in my settings.xml.

          In Nexus I see that the access is with no auth info (Nexus says anonymous).

          Should this issue be reopened or do you want me to submit a new jira?

          Show
          Anders Hammar added a comment - I can confirm that a deploy with altDeploymentRepository doesn't not work with auth in Maven 3.0-alpha-6. It does work with Maven 2.2.1 though. Here my command: mvn deploy -DaltDeploymentRepository=repo-xxx::default:: http://repo-xxx/content/repositories/releases A server with id 'repo-xxx' is defined in my settings.xml. In Nexus I see that the access is with no auth info (Nexus says anonymous). Should this issue be reopened or do you want me to submit a new jira?
          Hide
          Benjamin Bentmann added a comment -

          Anders, would you describe is a duplicate of MNG-4571.

          Show
          Benjamin Bentmann added a comment - Anders, would you describe is a duplicate of MNG-4571 .
          Benjamin Bentmann made changes -
          Link This issue relates to MNG-4571 [ MNG-4571 ]
          Hide
          Sarath Chandra added a comment -

          Looks like it is still an issue. I get this when trying to upload to nexus
          Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact serra:serra-we:jar:1.10-20101006.213417-2 from snapshots (http://serra.we/nexus/content/repositories/snapshots, releases=true, snapshots=true, managed=false): Error transferring file
          at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:860)
          at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:851)
          at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.flush(WagonRepositoryConnector.java:775)
          at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:389)
          at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:223)
          ... 24 more
          Caused by: org.apache.maven.wagon.TransferFailedException: Error transferring file
          at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:213)
          at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:413)
          at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
          at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
          at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:163)
          at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:736)
          at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:388)
          ... 25 more
          Caused by: java.io.IOException: Error writing to server
          at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:468)
          at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:480)
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1070)
          at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
          at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:185)
          ... 31 more

          Show
          Sarath Chandra added a comment - Looks like it is still an issue. I get this when trying to upload to nexus Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact serra:serra-we:jar:1.10-20101006.213417-2 from snapshots ( http://serra.we/nexus/content/repositories/snapshots , releases=true, snapshots=true, managed=false): Error transferring file at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:860) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:851) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.flush(WagonRepositoryConnector.java:775) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:389) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:223) ... 24 more Caused by: org.apache.maven.wagon.TransferFailedException: Error transferring file at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:213) at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:413) at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392) at org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365) at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:163) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:736) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:388) ... 25 more Caused by: java.io.IOException: Error writing to server at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:468) at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:480) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1070) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373) at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:185) ... 31 more
          Hide
          Asaf Mesika added a comment - - edited

          Same error as Sarath with Maven 3.0.1
          The authentication information is not used, as it is evident when watching the http network communication to nexus (tcpdump)

          UPDATE: Sorry - I missed the next tcp conversations. It works. Password was wrong

          Show
          Asaf Mesika added a comment - - edited Same error as Sarath with Maven 3.0.1 The authentication information is not used, as it is evident when watching the http network communication to nexus (tcpdump) UPDATE: Sorry - I missed the next tcp conversations. It works. Password was wrong

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Benjamin Bentmann
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: