[ http://jira.codehaus.org/browse/MNG-1245?page=comments#action_67054 ]
Mike Perham commented on MNG-1245: ---------------------------------- The code in question appears to be in MavenProject.replaceWithActiveArtifact: Note it should probably be doing some version checking also. {code} public Artifact replaceWithActiveArtifact( Artifact pluginArtifact ) { if ( getProjectReferences() != null && !getProjectReferences().isEmpty() ) { // TODO: use MavenProject getProjectReferenceId String refId = ArtifactUtils.versionlessKey( pluginArtifact.getGroupId(), pluginArtifact.getArtifactId() ); MavenProject ref = (MavenProject) getProjectReferences().get( refId ); if ( ref != null && ref.getArtifact() != null ) { // TODO: if not matching, we should get the correct artifact from that project (attached) if ( ref.getArtifact().getDependencyConflictId().equals( pluginArtifact.getDependencyConflictId() ) ) { // if the project artifact doesn't exist, don't use it. We haven't built that far. if ( ref.getArtifact().getFile() != null && ref.getArtifact().getFile().exists() ) { pluginArtifact = new ActiveProjectArtifact( ref, pluginArtifact ); } ...SNIP... } } } return pluginArtifact; } {code} > Reactor projects sometimes used even with version mismatch > ---------------------------------------------------------- > > Key: MNG-1245 > URL: http://jira.codehaus.org/browse/MNG-1245 > Project: Maven 2 > Type: Bug > Components: Plugins and Lifecycle > Versions: 2.0 > Reporter: Kenney Westerhof > Fix For: 2.0.5 > Attachments: deptest.tgz > > Original Estimate: 2 hours > Remaining: 2 hours > > See attached sample project structure. > In short: project A depends on project B version 1.1-SNAPSHOT, > but only 1.0-SNAPSHOT is available (both in the reactor, so on disk), as well > as in the local repository. > Still, m2 install runs fine. Excerpt from building Project A: > [DEBUG] Artifact not found - using stub model: Unable to download the > artifact from any repository > test:sub-b:1.1-SNAPSHOT:pom > ......configuring compiler plugin..... > [DEBUG] (f) classpathElements = > [/mnt/a/home/forge/work/sandbox/m2test/deptest/sub-a/target/classes, > /mnt/a/home/forge/work/sandbox/m2test/deptest/sub-b/target/classes] > Now, when running m2 eclipse:eclipse, m2 reacts as it should. Still the pom > stub-model is used, > but the .jar cannot be resolved. > (weird enough m2 eclipse:eclipse doesn't accept reactor dependencies during > resolve, > although the generated projects do have internal links - but this is a > different bug; this is a convenient bug for now.. ;)) > Proposed fix: Reactor projects can only be used when the pom versions match > too. I thought > this code was in months ago and working properly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira