John Casey created MNG-5475:
-------------------------------
Summary: [REGRESSION] repo and pluginRepo with different id's
prevent resolution of common parent POM
Key: MNG-5475
URL: https://jira.codehaus.org/browse/MNG-5475
Project: Maven 2 & 3
Issue Type: Bug
Components: Artifacts and Repositories
Affects Versions: 3.0.5, 3.0.4, 3.1.0-alpha-1
Environment: OS X (10.8.3), JDK 1.6
Reporter: John Casey
Priority: Critical
Attachments: repo-id-squash.zip
I have a settings.xml file with an activated profile that lists one repository
and one pluginRepository, both pointing at the same repo (on disk) BUT using
different repository id's.
In this repository, I have deployed a parent POM and a plugin. The plugin lists
the parent POM as its parent.
I also have another jar project that uses the parent POM as its parent, and
uses the plugin during its build.
NOW:
When building with Maven 3.0.3, the jar project build completes correctly. But,
when I build with ANY VERSION AFTER 3.0.3 (3.0.4, 3.0.5, 3.1.0-alpha-1 from
March 30th, io.tesla.maven.apache-maven 3.1.2...even though that's not part of
Apache Maven at all) IT FAILS.
The specific failure is that it cannot find the common parent POM as it's
trying to resolve the plugin. Looking closely at the build logs, you can see
Maven resolve the parent POM using the non-plugin repository, and update
_maven.repository (I've verified that this non-plugin repository's id is stored
here). Then, Maven tries to resolve the plugin POM, sees that the parent POM is
in the local repository and isn't set to be updated yet. So, it tries to verify
that that parent POM is available via the plugin repositories it knows
about...which is where _maven.repository seems to come in. It has the wrong
value, and causes Maven to discard the locally cached parent POM.
So, Maven won't update this parent POM in the local repo, but refuses to use
the one that's there because it came from the wrong place.
It seems like Aether is not smart enough to understand that the two
repositories are the same, even though the repository-id is different. I
suspect this could lead to VERY strange-seeming errors if two projects
referenced the same parent POM and repository URL but with different repo-id's.
I'm attaching a test case. It contains the repository with the parent POM and
the plugin, along with the source projects for each. It also contains the jar
project (bar-child) which has a settings.xml file in it. Finally, in the
bar-child/ directory you'll find build-*.log files corresponding to each
attempt I made with different Maven versions. The root directory is:
repo-id-squash/
NOTE: If you want to run the test case, you'll need to modify the paths in the
bar-child/settings.xml since they're currently specific to my filesystem.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira