Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 2.2.1, 3.0.3
-
Fix Version/s: None
-
Component/s: Artifacts and Repositories
-
Labels:None
-
Environment:Windows 7
-
Complexity:Intermediate
-
Number of attachments :1
Description
When accessing multiple repositories, Maven seems to use & keep <server> credentials used for the first repository accessed, with the other repositories.
For example, if we have 2 <repository> sections in our pom, accessed respectively with foo & bar usernames, "foo" credential will be used against the second repository, making authentication fails if foo is not authorized to access bar repository.
I settled up a minimal nexus configuration demonstrating the problem.
Nexus is defining 2 repositories (foo & bar).
Only foo user can access foo repository. The same goes for the bar repository. A special ci user can access both repositories.
A foo artefact has been uploaded in foo repository. A bar artefact has been uploaded in bar repository.
A pom.xml project defines bar repository with dependencies on foo & bar artefacts.
The foo repository is referenced as a mirror of central in settings.xml.
If, in settings.xml, we use foo user for foo server, and bar user for bar server, foo artefact cannot be retrieved in foo repository because bar user is not authorized to access foo repository (although it is not what is configured) : we can see this in nexus logs. The issue is here !
Note: If, in settings.xml, we use ci user for foo server, and bar user for bar server, foo artefact is retrieved (since ci user can both access foo & bar repositories).
Note 2 : I provided a zot repository, too, to distinguish the <repository> section from the settings.xml and the pom.xml sections. But the same problem is going on zot repository.
Problem seems to be really general : if we try to connect on N repositories using N <server> definitions, only the first <server> credentials are used (for the N repositories).
-
Hide
- jira authentication error on multiple credentials.zip
- 26/Jun/11 6:13 PM
- 93 kB
- Frédéric Camblor
-
- settings.xml.that.should.work 3 kB
- settings.xml 4 kB
- my-project/pom.xml 0.7 kB
- sonatype-work/README.txt 0.3 kB
- sonatype-work/nexus/.../log4j.properties 1 kB
- sonatype-work/nexus/conf/lvo-plugin.xml 2 kB
- sonatype-work/nexus/conf/nexus.xml 5 kB
- sonatype-work/.../security-configuration.xml 0.4 kB
- sonatype-work/nexus/conf/security.xml 12 kB
- sonatype-work/.../nexus-maven-repository-index-packer.properties 0.2 kB
- sonatype-work/nexus/.../bar-ctx/segments.gen 0.0 kB
- sonatype-work/nexus/.../bar-ctx/segments_b 0.8 kB
- sonatype-work/nexus/.../bar-ctx/timestamp 0.0 kB
- sonatype-work/nexus/.../bar-ctx/_6.fdt 0.1 kB
- sonatype-work/nexus/.../bar-ctx/_6.fdx 0.0 kB
- sonatype-work/nexus/.../bar-ctx/_6.fnm 0.1 kB
- sonatype-work/nexus/.../bar-ctx/_6.frq 0.0 kB
- sonatype-work/nexus/.../bar-ctx/_6.nrm 0.0 kB
- sonatype-work/nexus/.../bar-ctx/_6.prx 0.0 kB
- sonatype-work/nexus/.../bar-ctx/_6.tii 0.0 kB
- sonatype-work/nexus/.../bar-ctx/_6.tis 0.1 kB
- sonatype-work/nexus/.../bar-ctx/_6_3.del 0.0 kB
- sonatype-work/nexus/.../bar-ctx/_7.cfs 0.3 kB
- sonatype-work/nexus/.../bar-ctx/_8.cfs 0.6 kB
- sonatype-work/nexus/.../bar-ctx/_9.cfs 0.4 kB
- sonatype-work/.../nexus-maven-repository-index-packer.properties 0.2 kB
- sonatype-work/nexus/.../foo-ctx/segments.gen 0.0 kB
- sonatype-work/nexus/.../foo-ctx/segments_b 0.8 kB
- sonatype-work/nexus/.../foo-ctx/timestamp 0.0 kB
- sonatype-work/nexus/.../foo-ctx/_6.fdt 0.1 kB
To be clearer, replace sentence "If, in settings.xml, we use foo user for foo server, and bar user for bar server, foo artefact cannot be retrieved in foo repository because bar user is not authorized to access foo repository (although it is not what is configured) : we can see this in nexus logs. The issue is here !"
By :
"If, in settings.xml, we use foo user for foo server, and bar user for bar server, foo artefact cannot be retrieved in foo repository because bar user is SELECTED FOR AUTHENTICATION AND not authorized to access foo repository (although it is not what is configured) : we can see this in nexus logs. The issue is here !"
I found the issue under maven 2.2.1.
Tried to reproduce it on Maven 3.0.3 ... it seems the problem is still there in aether (message is clearer but seems to remain related to the same authentication problems)