Bernd Vogt created MNG-5385: ------------------------------- Summary: Session overlayed by LegacyLocalRepositoryManager.overlay(...) returns different local repositories Key: MNG-5385 URL: https://jira.codehaus.org/browse/MNG-5385 Project: Maven 2 & 3 Issue Type: Bug Affects Versions: 3.0.4 Reporter: Bernd Vogt Priority: Critical Attachments: LegacyLocalRepositoryManager.java.patch, LegacyLocalRepositoryManagerTest.java
To use a custom local repository during the resolution of an artifact, you have to overlay the default repo session with the custom information. For that LegacyLocalRepositoryManager.overlay(...) is intended. But after overlaying the current session with a custom local repository the returend overlayed session knows two local repositories: {noformat} RepositorySystemSession overlayed = egacyLocalRepositoryManager.overlay(myLocalRepo, session, system); overlayed.getLocalRepositoryManager().getRepository() // returns 'myLocalRepo' overlayed.getLocalRepository() // should return 'myLocalRepo' but returns the default local repositoy {noformat} This is a problem, because both methods are used to get the local repo during artifact resolution, e.g. {noformat} class org.apache.maven.repository.internal.DefaultVersionResolver.Key { public Key( RepositorySystemSession session, VersionRequest request ) { ... localRepo = session.getLocalRepository().getBasedir(); {noformat}, {noformat} class org.sonatype.aether.impl.internal.DefaultMetadataResolver { private List<MetadataResult> resolve( RepositorySystemSession session, Collection<? extends MetadataRequest> requests ) { ... LocalRepository localRepo = session.getLocalRepositoryManager().getRepository(); {noformat} (Critical because of our tooling to materialize artifacts to a specified folder is broken since we migrated from Maven 2 to 3...) -- 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