maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kent Granström (JIRA) <j...@apache.org>
Subject [jira] [Commented] (MDEP-579) Regression: get goal does not pass server credentials to BasicRepositoryConnector
Date Tue, 13 Aug 2019 11:22:00 GMT

    [ https://issues.apache.org/jira/browse/MDEP-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16906092#comment-16906092
] 

Kent Granström commented on MDEP-579:
-------------------------------------

Hi [~pmoerenhout].

We're actually using a usertoken and pwtoken generated by our Nexus instance but that basically
equals to username and pw. I'm not allowed to hand out anything from our environment but for
the sake of this issue I have written a somewhat equivalent configuration of what I'm doing
to get this behaviour. Obviously the path, user and pw doesn't map to the real world but
perhaps its enough for you to be able to reproduce the issue. 

Running a bat-file from the commandline in Windows:
{code:java}
In get.bat (toggling 3.1.1 and 3.1.2-SNAPSHOT):

mvn clean -X org.apache.maven.plugins:maven-dependency-plugin:3.1.2-SNAPSHOT:get ^
 -Dartifact= com.test.note:note-docker:4.1:zip ^
 -DremoteRepositories=internal-repo-id::default::https://example.com/nexus/repository/internal-repo
^
 -Dtransitive=false


This is settings.xml:

<?xml version="1.0"?>

<settings>

 <servers>
   <server>
     <id>nexus</id>
     <username>SomeUser</username>
     <password>APassword</password>
   </server>

   <server>
     <id>internal-repo-id</id>
     <username>SomeUSer</username>
     <password>APAssword</password>
   </server>
 </servers>

 <mirrors>
   <mirror>
     <id>nexus</id>
     <name>Our Public repo group</name>
     <url>https://example.com/nexus/repository/public-repo</url>
     <mirrorOf>*,!internal-repo</mirrorOf>
   </mirror>

   <mirror>
     <id>internal-repo</id>
     <name>Our internal artifact group</name>
     <url>https://example.com/nexus/repository/internal-repo</url>
     <mirrorOf>internal-repo</mirrorOf>
   </mirror>
 </mirrors>
</settings>{code}
Hope this helps.

 

> Regression: get goal does not pass server credentials to BasicRepositoryConnector
> ---------------------------------------------------------------------------------
>
>                 Key: MDEP-579
>                 URL: https://issues.apache.org/jira/browse/MDEP-579
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: get
>    Affects Versions: 3.0.0, 3.0.1
>            Reporter: Richard W. Eggert II
>            Priority: Critical
>              Labels: credentials
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The {{get}} goal does not pass the server credentials from {{settings.xml}} to the {{BasicRepositoryConnector}}
in version 3.0.1 (and, presumably 3.0.0), resulting in {{NotAuthorized}} errors when resolving
artifacts against repositories that require authentication. It works correctly in version
2.9.
> Background: I discovered this in the course of debugging a Jenkins job in which I'm using
the {{get}} and {{copy}} goals from the command line (with no POM) to download artifacts to
deploy. After spending several hours thinking that Jenkins was not properly configuring {{settings.xml}},
I noticed from the Maven debug output that the credentials were being passed when resolving
the maven-dependency-plugin and its dependencies, but not being passed when resolving the
artifact I requested. On a hunch I downgraded from maven-dependency-plugin version 3.0.1 to
2.9, and suddenly everything magically worked.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Mime
View raw message