Author: fgiust
Date: Tue Apr  4 13:49:22 2006
New Revision: 391409

URL: http://svn.apache.org/viewcvs?rev=391409&view=rev
Log:
MECLIPSE-64 Allow Natures and Builders to be Added instead of Replaced

Added:
    maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/
    
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/classpath
    
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/pom.xml   
(with props)
    
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/project
Modified:
    
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
    
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java

Modified: 
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java?rev=391409&r1=391408&r2=391409&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
 (original)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
 Tue Apr  4 13:49:22 2006
@@ -94,7 +94,7 @@
     /**
      * List of eclipse project natures. By default the
      * <code>org.eclipse.jdt.core.javanature</code> nature plus the needed WTP
-     * natures are added.
+     * natures are added. Natures added using this property 
<strong>replace</strong> the default list.
      * 
      * <pre>
      * &lt;projectnatures&gt;
@@ -108,14 +108,27 @@
     private List projectnatures;
 
     /**
+     * List of eclipse project natures to be added to the default ones.
+     * 
+     * <pre>
+     * &lt;additionalProjectnatures&gt;
+     *    
&lt;projectnature&gt;org.springframework.ide.eclipse.core.springnature&lt;/projectnature&gt;
+     * &lt;/additionalProjectnatures&gt;
+     * </pre>
+     * 
+     * @parameter
+     */
+    private List additionalProjectnatures;
+
+    /**
      * List of eclipse build commands. By default the 
<code>org.eclipse.jdt.core.javabuilder</code> builder plus the needed
      * WTP builders are added. Configuration example:
      * 
      * <pre>
      * &lt;buildcommands&gt;
-     *    
&lt;java.lang.String&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilder&lt;/java.lang.String&gt;
-     *    
&lt;java.lang.String&gt;org.eclipse.jdt.core.javabuilder&lt;/java.lang.String&gt;
-     *    
&lt;java.lang.String&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver&lt;/java.lang.String&gt;
+     *    
&lt;buildcommand&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilder&lt;/buildcommand&gt;
+     *    
&lt;buildcommand&gt;org.eclipse.jdt.core.javabuilder&lt;/buildcommand&gt;
+     *    
&lt;buildcommand&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver&lt;/buildcommand&gt;
      * &lt;/buildcommands&gt;
      * </pre>
      * 
@@ -124,6 +137,19 @@
     private List buildcommands;
 
     /**
+     * List of eclipse build commands to be added to the default ones.
+     * 
+     * <pre>
+     * &lt;additionalBuildcommands&gt;
+     *    
&lt;buildcommand&gt;org.springframework.ide.eclipse.core.springbuilder&lt;/buildcommand&gt;
+     * &lt;/additionalBuildcommands&gt;
+     * </pre>
+     * 
+     * @parameter
+     */
+    private List additionalBuildcommands;
+
+    /**
      * List of container classpath entries. By default the 
<code>org.eclipse.jdt.launching.JRE_CONTAINER</code> classpath
      * container is added. Configuration example: 
      * <pre>
@@ -318,6 +344,42 @@
     }
 
     /**
+     * Getter for <code>additionalBuildcommands</code>.
+     * @return Returns the additionalBuildcommands.
+     */
+    public List getAdditionalBuildcommands()
+    {
+        return this.additionalBuildcommands;
+    }
+
+    /**
+     * Setter for <code>additionalBuildcommands</code>.
+     * @param additionalBuildcommands The additionalBuildcommands to set.
+     */
+    public void setAdditionalBuildcommands( List additionalBuildcommands )
+    {
+        this.additionalBuildcommands = additionalBuildcommands;
+    }
+
+    /**
+     * Getter for <code>additionalProjectnatures</code>.
+     * @return Returns the additionalProjectnatures.
+     */
+    public List getAdditionalProjectnatures()
+    {
+        return this.additionalProjectnatures;
+    }
+
+    /**
+     * Setter for <code>additionalProjectnatures</code>.
+     * @param additionalProjectnatures The additionalProjectnatures to set.
+     */
+    public void setAdditionalProjectnatures( List additionalProjectnatures )
+    {
+        this.additionalProjectnatures = additionalProjectnatures;
+    }
+
+    /**
      * @see org.apache.maven.plugin.Mojo#execute()
      */
     public boolean setup()
@@ -399,9 +461,19 @@
             fillDefaultNatures( packaging );
         }
 
+        if ( additionalProjectnatures != null )
+        {
+            projectnatures.addAll( additionalProjectnatures );
+        }
+
         if ( buildcommands == null )
         {
             fillDefaultBuilders( packaging );
+        }
+
+        if ( additionalBuildcommands != null )
+        {
+            buildcommands.addAll( additionalBuildcommands );
         }
 
         if ( classpathContainers == null )

Modified: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java?rev=391409&r1=391408&r2=391409&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java
 (original)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java
 Tue Apr  4 13:49:22 2006
@@ -114,4 +114,14 @@
     {
         testProject( "project-13" );
     }
+
+    /**
+     * Additional natures and builders - MECLIPSE-64
+     * @throws Exception any exception thrown during test
+     */
+    public void testProject14()
+        throws Exception
+    {
+        testProject( "project-14" );
+    }
 }

Added: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/classpath
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/classpath?rev=391409&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/classpath 
(added)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/classpath 
Tue Apr  4 13:49:22 2006
@@ -0,0 +1,4 @@
+<classpath>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/pom.xml?rev=391409&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/pom.xml 
(added)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/pom.xml 
Tue Apr  4 13:49:22 2006
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>eclipse</groupId>
+  <artifactId>maven-eclipse-plugin-test-project-14</artifactId>
+  <version>14</version>
+  <name>maven-eclipse-plugin-test-project-14en</name>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-eclipse-plugin</artifactId>
+        <configuration>
+          <additionalProjectnatures>
+            
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
+          </additionalProjectnatures>
+          <additionalBuildcommands>
+            
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
+          </additionalBuildcommands>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/project
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/project?rev=391409&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/project 
(added)
+++ 
maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-14/project 
Tue Apr  4 13:49:22 2006
@@ -0,0 +1,19 @@
+<projectDescription>
+  <name>maven-eclipse-plugin-test-project-14</name>
+  <comment/>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+      <arguments/>
+    </buildCommand>
+    <buildCommand>
+      <name>org.springframework.ide.eclipse.core.springbuilder</name>
+      <arguments/>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+    <nature>org.springframework.ide.eclipse.core.springnature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file


Reply via email to