Author: jdcasey
Date: Mon Jun 20 20:57:17 2005
New Revision: 191620

URL: http://svn.apache.org/viewcvs?rev=191620&view=rev
Log:
Resolving issue: MNG-493

o Changed getExecutionsAsMap() in Plugin (within maven.mdo) to throw an 
IllegalStateException if two PluginExecutions are detected with the same id. 
This method should always be called during inheritance assembly...

o Changed PluginExecution's id field to have a defaultValue of 'default' within 
maven.mdo.

NOTE: It may be necessary to double-check the id-collision within 
MavenProjectBuilder, in case there is no inheritance of plugins...I'll add 
this, and follow this commit momentarily.


Added:
    maven/components/trunk/maven-core-it/it1006/
    maven/components/trunk/maven-core-it/it1006/expected-results.txt   (with 
props)
    maven/components/trunk/maven-core-it/it1006/goals.txt   (with props)
    maven/components/trunk/maven-core-it/it1006/pom.xml   (with props)
    maven/components/trunk/maven-core-it/it1006/src/
    maven/components/trunk/maven-core-it/it1006/src/main/
    maven/components/trunk/maven-core-it/it1006/src/main/java/
    maven/components/trunk/maven-core-it/it1006/src/main/java/org/
    maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/
    maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/
    
maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/it0023/
    
maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/it0023/Person.java
   (with props)
Modified:
    maven/components/trunk/maven-core-it/README.txt
    maven/components/trunk/maven-model/maven.mdo

Modified: maven/components/trunk/maven-core-it/README.txt
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/README.txt?rev=191620&r1=191619&r2=191620&view=diff
==============================================================================
--- maven/components/trunk/maven-core-it/README.txt (original)
+++ maven/components/trunk/maven-core-it/README.txt Mon Jun 20 20:57:17 2005
@@ -130,3 +130,7 @@
 -------------------------------------------------------------------------------
 it1005: A build with two mojo java sources that declare the same goal.
 -------------------------------------------------------------------------------
+it1006: Tests collision on default execution id. Should throw an 
+        IllegalStateException, since the model is incorrect.
+-------------------------------------------------------------------------------
+

Added: maven/components/trunk/maven-core-it/it1006/expected-results.txt
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it1006/expected-results.txt?rev=191620&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it1006/expected-results.txt (added)
+++ maven/components/trunk/maven-core-it/it1006/expected-results.txt Mon Jun 20 
20:57:17 2005
@@ -0,0 +1,2 @@
+target/test.txt
+target/test2.txt

Propchange: maven/components/trunk/maven-core-it/it1006/expected-results.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it1006/expected-results.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it1006/goals.txt
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it1006/goals.txt?rev=191620&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it1006/goals.txt (added)
+++ maven/components/trunk/maven-core-it/it1006/goals.txt Mon Jun 20 20:57:17 
2005
@@ -0,0 +1 @@
+process-sources

Propchange: maven/components/trunk/maven-core-it/it1006/goals.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it1006/goals.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it1006/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it1006/pom.xml?rev=191620&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it1006/pom.xml (added)
+++ maven/components/trunk/maven-core-it/it1006/pom.xml Mon Jun 20 20:57:17 2005
@@ -0,0 +1,35 @@
+<model>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.</groupId>
+  <artifactId>maven-it0025</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-core-it-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <configuration>
+              <pluginItem>test.txt</pluginItem>
+            </configuration>
+            
+            <goals>
+              <goal>touch</goal>
+            </goals>
+          </execution>
+          <execution>
+            <configuration>
+              <pluginItem>test2.txt</pluginItem>
+            </configuration>
+            <goals>
+              <goal>touch</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</model>

Propchange: maven/components/trunk/maven-core-it/it1006/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it1006/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/it0023/Person.java
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/it0023/Person.java?rev=191620&view=auto
==============================================================================
--- 
maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/it0023/Person.java
 (added)
+++ 
maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/it0023/Person.java
 Mon Jun 20 20:57:17 2005
@@ -0,0 +1,16 @@
+package org.apache.maven.it0023;
+
+public class Person
+{
+    private String name;
+    
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+    
+    public String getName()
+    {
+        return name;
+    }
+}

Propchange: 
maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/it0023/Person.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/components/trunk/maven-core-it/it1006/src/main/java/org/apache/maven/it0023/Person.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/components/trunk/maven-model/maven.mdo
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-model/maven.mdo?rev=191620&r1=191619&r2=191620&view=diff
==============================================================================
--- maven/components/trunk/maven-model/maven.mdo (original)
+++ maven/components/trunk/maven-model/maven.mdo Mon Jun 20 20:57:17 2005
@@ -2162,6 +2162,12 @@
                 for ( Iterator i = getExecutions().iterator(); i.hasNext(); )
                 {
                     PluginExecution exec = (PluginExecution) i.next();
+                    
+                    if ( executionMap.containsKey( exec.getId() ) )
+                    {
+                        throw new IllegalStateException( "You cannot have two 
plugin executions with the same (or missing) <id/> elements.\nOffending 
execution\n\nId: \'" + exec.getId() + "\'\nPlugin:\'" + getKey() + "\'\n\n" );
+                    }
+                    
                     executionMap.put( exec.getId(), exec );
                 }
             }
@@ -2219,6 +2225,7 @@
           <version>4.0.0</version>
           <required>true</required>
           <type>String</type>
+          <defaultValue>default</defaultValue>
         </field>
         <field>
           <name>phase</name>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to