Author: epunzalan
Date: Tue Feb 28 19:35:07 2006
New Revision: 381895
URL: http://svn.apache.org/viewcvs?rev=381895&view=rev
Log:
PR: MIDEA-23
Submitted by: Jeremy Boynes
Applied patch for the option to use full artifact names
Modified:
maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
Modified:
maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
URL:
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java?rev=381895&r1=381894&r2=381895&view=diff
==============================================================================
---
maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
(original)
+++
maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
Tue Feb 28 19:35:07 2006
@@ -129,6 +129,13 @@
*/
private List reactorProjects;
+ /**
+ * Whether to use full artifact names when referencing libraries.
+ *
+ * @parameter expression="${useFullNames}" default-value="false"
+ */
+ private boolean useFullNames;
+
public void execute()
throws MojoExecutionException
{
@@ -437,7 +444,16 @@
{
dep.setAttribute( "type", "module-library" );
dep = createElement( dep, "library" );
- dep.setAttribute( "name", a.getArtifactId() );
+ String moduleName;
+ if ( useFullNames )
+ {
+ moduleName = a.getGroupId() + ':' + a.getArtifactId()
+ ':' + a.getType() + ':' + a.getVersion();
+ }
+ else
+ {
+ moduleName = a.getArtifactId();
+ }
+ dep.setAttribute( "name", moduleName );
Xpp3Dom el = createElement( dep, "CLASSES" );
el = createElement( el, "root" );