maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r804374 - /maven/components/trunk/maven-model/src/main/mdo/maven.mdo
Date Fri, 14 Aug 2009 21:08:24 GMT
Author: bentmann
Date: Fri Aug 14 21:08:23 2009
New Revision: 804374

URL: http://svn.apache.org/viewvc?rev=804374&view=rev
Log:
o Added Plugin.getId()

Modified:
    maven/components/trunk/maven-model/src/main/mdo/maven.mdo

Modified: maven/components/trunk/maven-model/src/main/mdo/maven.mdo
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-model/src/main/mdo/maven.mdo?rev=804374&r1=804373&r2=804374&view=diff
==============================================================================
--- maven/components/trunk/maven-model/src/main/mdo/maven.mdo (original)
+++ maven/components/trunk/maven-model/src/main/mdo/maven.mdo Fri Aug 14 21:08:23 2009
@@ -2794,6 +2794,24 @@
         return executionMap;
     }
 
+    /**
+     * Gets the identifier of the plugin.
+     * 
+     * @return The plugin id in the form {@code <groupId>:<artifactId>:<version>},
never {@code null}.
+     */
+    public String getId()
+    {
+        StringBuilder id = new StringBuilder( 128 );
+
+        id.append( ( getGroupId() == null ) ? "[unknown-group-id]" : getGroupId() );
+        id.append( ":" );
+        id.append( ( getArtifactId() == null ) ? "[unknown-artifact-id]" : getArtifactId()
);
+        id.append( ":" );
+        id.append( ( getVersion() == null ) ? "[unknown-version]" : getVersion() );
+
+        return id.toString();
+    }
+
     //TODO we shall reset key variable when groupId/artifactId change
     private String key = null;
     /**



Mime
View raw message