continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r349412 - /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
Date Mon, 28 Nov 2005 16:14:06 GMT
Author: evenisse
Date: Mon Nov 28 08:14:00 2005
New Revision: 349412

URL: http://svn.apache.org/viewcvs?rev=349412&view=rev
Log:
[CONTINUUM-480] Use project name as groupId and artifactId if groupId and artifactId are null
like in ant and shell project.
Added version too to project identifier.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java?rev=349412&r1=349411&r2=349412&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
Mon Nov 28 08:14:00 2005
@@ -118,11 +118,35 @@
 
     private static String getProjectId( Project project )
     {
-        return project.getGroupId() + ":" + project.getArtifactId();
+        String groupId;
+
+        String artifactId;
+
+        if ( project.getGroupId() == null )
+        {
+            groupId = project.getName();
+        }
+        else
+        {
+            groupId = project.getGroupId();
+        }
+
+        if ( project.getArtifactId() == null )
+        {
+            artifactId = project.getName();
+        }
+        else
+        {
+            artifactId = project.getArtifactId();
+        }
+        
+        String id = groupId + ":" + artifactId + ":" + project.getVersion();
+
+        return id;
     }
 
     private static String getDependencyId( ProjectDependency project )
     {
-        return project.getGroupId() + ":" + project.getArtifactId();
+        return project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
     }
 }



Mime
View raw message