Author: jmcconnell
Date: Sun May 14 16:31:52 2006
New Revision: 406471

URL: http://svn.apache.org/viewcvs?rev=406471&view=rev
Log:
using -DideaPlugin=true will allow you to build a idea plugin module, with the 
plugin.xml located in the normal place for META-INF stuff, src/main/resources

Modified:
    
maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java

Modified: 
maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java?rev=406471&r1=406470&r2=406471&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java
 Sun May 14 16:31:52 2006
@@ -163,6 +163,11 @@
      */
     private static Map attemptedDownloads = new HashMap();
 
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean ideaPlugin;
+
     private Set macros;
 
     public void initParam( MavenProject project, ArtifactFactory 
artifactFactory, ArtifactRepository localRepo,
@@ -246,6 +251,10 @@
             {
                 addEarModule( module );
             }
+            else if ( ideaPlugin )
+            {
+                addPluginModule( module );
+            }
 
             Element component = findComponent( module, "NewModuleRootManager" 
);
             Element output = findElement( component, "output" );
@@ -763,6 +772,15 @@
         element = createElement( element, "root" );
         element.addAttribute( "relative", "/" );
         element.addAttribute( "url", getModuleFileUrl( warSrc ) );
+    }
+
+    private void addPluginModule( Element module ){
+        module.addAttribute( "type", "PLUGIN_MODULE" );
+
+        // this is where the META-INF/plugin.xml file is located
+        Element pluginDevElement = createElement( module, "component" );
+        pluginDevElement.addAttribute( "name", "DevKit.ModuleBuildProperties" 
);
+        pluginDevElement.addAttribute( "url", getModuleFileUrl( 
executedProject.getBasedir(), "src/main/resources" ) );
     }
 
     /**


Reply via email to