maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ken...@apache.org
Subject svn commit: r419624 - /maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Date Thu, 06 Jul 2006 17:28:00 GMT
Author: kenney
Date: Thu Jul  6 10:28:00 2006
New Revision: 419624

URL: http://svn.apache.org/viewvc?rev=419624&view=rev
Log:
PR: MNG-1245

Version not taken into account for reactor projects. 

Artifacts for reactor projects get replaced by a wrong version local repo artifact.

Modified:
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=419624&r1=419623&r2=419624&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Thu Jul  6 10:28:00 2006
@@ -474,7 +474,7 @@
                 if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals(
a.getScope() ) ||
                     Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
                 {
-                    String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId()
);
+                    String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId(),
a.getVersion() );
                     MavenProject project = (MavenProject) projectReferences.get( refId );
                     if ( project != null )
                     {
@@ -745,7 +745,7 @@
                 // TODO: let the scope handler deal with this
                 if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
                 {
-                    String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId()
);
+                    String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId(),
a.getVersion() );
                     MavenProject project = (MavenProject) projectReferences.get( refId );
                     if ( project != null )
                     {
@@ -1553,12 +1553,12 @@
 
     public void addProjectReference( MavenProject project )
     {
-        projectReferences.put( getProjectReferenceId( project.getGroupId(), project.getArtifactId()
), project );
+        projectReferences.put( getProjectReferenceId( project.getGroupId(), project.getArtifactId(),
project.getVersion() ), project );
     }
 
-    private static String getProjectReferenceId( String groupId, String artifactId )
+    private static String getProjectReferenceId( String groupId, String artifactId, String
version )
     {
-        return groupId + ":" + artifactId;
+        return groupId + ":" + artifactId + ":" + version;
     }
 
     /**
@@ -1602,8 +1602,7 @@
     {
         if ( getProjectReferences() != null && !getProjectReferences().isEmpty()
)
         {
-            // TODO: use MavenProject getProjectReferenceId
-            String refId = ArtifactUtils.versionlessKey( pluginArtifact.getGroupId(), pluginArtifact.getArtifactId()
);
+            String refId = getProjectReferenceId( pluginArtifact.getGroupId(), pluginArtifact.getArtifactId(),
pluginArtifact.getVersion() );
             MavenProject ref = (MavenProject) getProjectReferences().get( refId );
             if ( ref != null && ref.getArtifact() != null )
             {



Mime
View raw message