You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ken Wong (JIRA)" <ji...@codehaus.org> on 2009/12/08 03:39:55 UTC

[jira] Created: (MNG-4487) POM allows duplicate plugin configuration

POM allows duplicate plugin configuration
-----------------------------------------

                 Key: MNG-4487
                 URL: http://jira.codehaus.org/browse/MNG-4487
             Project: Maven 2
          Issue Type: Improvement
    Affects Versions: 2.0.9
            Reporter: Ken Wong
            Priority: Minor


I have a project that uses FlexMOJO to compile the swc and then optimize and create a swf. If you look at the following pom extract, you will see that I defined the configuration for the same plugin twice (flexmojos-maven-plugin). There was no error but having the duplicate definition caused maven to be confused and the locale and namespace parameters ended up being 'lost'. If I comment out the 2nd part, then it works. If having duplicate definition confuses maven, it would be nice to have it throw an error when it sees duplicate configuration for the same plugin, instead of yielding confusing result.

build>
                <plugins>
                        <plugin>
                                <groupId>org.sonatype.flexmojos</groupId>
                                <artifactId>flexmojos-maven-plugin</artifactId>

                                <configuration>
                                        <compiledLocales>
                                                <locale>en_US</locale>
                                                <locale>es_ES</locale>
                                                <locale>ja_JP</locale>
                                        </compiledLocales>

resourceBundlePath>

                                        <namespaces>
                                                <namespace>
                                                        <uri>http://www.stoneriver.com/2009/uicore</uri>
                                                        <manifest>${basedir}/src/manifest.xml</manifest>
                                                </namespace>
                                        </namespaces>

                                        <includeNamespaces>
                                                <namespace>http://www.stoneriver.com/2009/uicore</namespace>
                                        </includeNamespaces>

                                </configuration>
                        </plugin>


                                 <plugin>
                                 <groupId>org.sonatype.flexmojos</groupId>
                                 <artifactId>flexmojos-maven-plugin</artifactId>
                                 <executions>
                                 <execution>
                                 <goals>
                                 <goal>optimize</goal>
                                 </goals>
                                 </execution>
                                 </executions>
                                 </plugin>
 
                </plugins> 
</build>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4487) POM allows duplicate plugin configuration

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-4487:
-----------------------------------

    Attachment: MNG-4487.zip

A complete example project with a duplicate plugin declaration as suggested by your POM snippet. Independently of the question whether this should cause a warning/error, I don't see how this confuses Maven. This example builds (the duplicate declarations are merged).

> POM allows duplicate plugin configuration
> -----------------------------------------
>
>                 Key: MNG-4487
>                 URL: http://jira.codehaus.org/browse/MNG-4487
>             Project: Maven 2
>          Issue Type: Improvement
>    Affects Versions: 2.0.9
>            Reporter: Ken Wong
>            Priority: Minor
>         Attachments: MNG-4487.zip
>
>
> I have a project that uses FlexMOJO to compile the swc and then optimize and create a swf. If you look at the following pom extract, you will see that I defined the configuration for the same plugin twice (flexmojos-maven-plugin). There was no error but having the duplicate definition caused maven to be confused and the locale and namespace parameters ended up being 'lost'. If I comment out the 2nd part, then it works. If having duplicate definition confuses maven, it would be nice to have it throw an error when it sees duplicate configuration for the same plugin, instead of yielding confusing result.
> build>
>                 <plugins>
>                         <plugin>
>                                 <groupId>org.sonatype.flexmojos</groupId>
>                                 <artifactId>flexmojos-maven-plugin</artifactId>
>                                 <configuration>
>                                         <compiledLocales>
>                                                 <locale>en_US</locale>
>                                                 <locale>es_ES</locale>
>                                                 <locale>ja_JP</locale>
>                                         </compiledLocales>
> resourceBundlePath>
>                                         <namespaces>
>                                                 <namespace>
>                                                         <uri>http://www.stoneriver.com/2009/uicore</uri>
>                                                         <manifest>${basedir}/src/manifest.xml</manifest>
>                                                 </namespace>
>                                         </namespaces>
>                                         <includeNamespaces>
>                                                 <namespace>http://www.stoneriver.com/2009/uicore</namespace>
>                                         </includeNamespaces>
>                                 </configuration>
>                         </plugin>
>                                  <plugin>
>                                  <groupId>org.sonatype.flexmojos</groupId>
>                                  <artifactId>flexmojos-maven-plugin</artifactId>
>                                  <executions>
>                                  <execution>
>                                  <goals>
>                                  <goal>optimize</goal>
>                                  </goals>
>                                  </execution>
>                                  </executions>
>                                  </plugin>
>  
>                 </plugins> 
> </build>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4487) POM allows duplicate plugin configuration

Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Gier updated MNG-4487:
---------------------------

    Attachment: pom.xml

> POM allows duplicate plugin configuration
> -----------------------------------------
>
>                 Key: MNG-4487
>                 URL: http://jira.codehaus.org/browse/MNG-4487
>             Project: Maven 2 & 3
>          Issue Type: Improvement
>    Affects Versions: 2.0.9
>            Reporter: Ken Wong
>            Priority: Minor
>         Attachments: MNG-4487.zip, pom.xml
>
>
> I have a project that uses FlexMOJO to compile the swc and then optimize and create a swf. If you look at the following pom extract, you will see that I defined the configuration for the same plugin twice (flexmojos-maven-plugin). There was no error but having the duplicate definition caused maven to be confused and the locale and namespace parameters ended up being 'lost'. If I comment out the 2nd part, then it works. If having duplicate definition confuses maven, it would be nice to have it throw an error when it sees duplicate configuration for the same plugin, instead of yielding confusing result.
> build>
>                 <plugins>
>                         <plugin>
>                                 <groupId>org.sonatype.flexmojos</groupId>
>                                 <artifactId>flexmojos-maven-plugin</artifactId>
>                                 <configuration>
>                                         <compiledLocales>
>                                                 <locale>en_US</locale>
>                                                 <locale>es_ES</locale>
>                                                 <locale>ja_JP</locale>
>                                         </compiledLocales>
> resourceBundlePath>
>                                         <namespaces>
>                                                 <namespace>
>                                                         <uri>http://www.stoneriver.com/2009/uicore</uri>
>                                                         <manifest>${basedir}/src/manifest.xml</manifest>
>                                                 </namespace>
>                                         </namespaces>
>                                         <includeNamespaces>
>                                                 <namespace>http://www.stoneriver.com/2009/uicore</namespace>
>                                         </includeNamespaces>
>                                 </configuration>
>                         </plugin>
>                                  <plugin>
>                                  <groupId>org.sonatype.flexmojos</groupId>
>                                  <artifactId>flexmojos-maven-plugin</artifactId>
>                                  <executions>
>                                  <execution>
>                                  <goals>
>                                  <goal>optimize</goal>
>                                  </goals>
>                                  </execution>
>                                  </executions>
>                                  </plugin>
>  
>                 </plugins> 
> </build>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4487) POM allows duplicate plugin configuration

Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=229406#action_229406 ] 

Paul Gier commented on MNG-4487:
--------------------------------

Maven also silently ignores duplicate plugin parameter definitions.  I attached a sample pom which demonstrates this.  Maven should probably just produce a warning for these situations.

> POM allows duplicate plugin configuration
> -----------------------------------------
>
>                 Key: MNG-4487
>                 URL: http://jira.codehaus.org/browse/MNG-4487
>             Project: Maven 2 & 3
>          Issue Type: Improvement
>    Affects Versions: 2.0.9
>            Reporter: Ken Wong
>            Priority: Minor
>         Attachments: MNG-4487.zip, pom.xml
>
>
> I have a project that uses FlexMOJO to compile the swc and then optimize and create a swf. If you look at the following pom extract, you will see that I defined the configuration for the same plugin twice (flexmojos-maven-plugin). There was no error but having the duplicate definition caused maven to be confused and the locale and namespace parameters ended up being 'lost'. If I comment out the 2nd part, then it works. If having duplicate definition confuses maven, it would be nice to have it throw an error when it sees duplicate configuration for the same plugin, instead of yielding confusing result.
> build>
>                 <plugins>
>                         <plugin>
>                                 <groupId>org.sonatype.flexmojos</groupId>
>                                 <artifactId>flexmojos-maven-plugin</artifactId>
>                                 <configuration>
>                                         <compiledLocales>
>                                                 <locale>en_US</locale>
>                                                 <locale>es_ES</locale>
>                                                 <locale>ja_JP</locale>
>                                         </compiledLocales>
> resourceBundlePath>
>                                         <namespaces>
>                                                 <namespace>
>                                                         <uri>http://www.stoneriver.com/2009/uicore</uri>
>                                                         <manifest>${basedir}/src/manifest.xml</manifest>
>                                                 </namespace>
>                                         </namespaces>
>                                         <includeNamespaces>
>                                                 <namespace>http://www.stoneriver.com/2009/uicore</namespace>
>                                         </includeNamespaces>
>                                 </configuration>
>                         </plugin>
>                                  <plugin>
>                                  <groupId>org.sonatype.flexmojos</groupId>
>                                  <artifactId>flexmojos-maven-plugin</artifactId>
>                                  <executions>
>                                  <execution>
>                                  <goals>
>                                  <goal>optimize</goal>
>                                  </goals>
>                                  </execution>
>                                  </executions>
>                                  </plugin>
>  
>                 </plugins> 
> </build>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4487) POM allows duplicate plugin configuration

Posted by "Ken Wong (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=201836#action_201836 ] 

Ken Wong commented on MNG-4487:
-------------------------------

I wonder if this issue is specific to FlexMOJO 3.x? All I know is if the 2nd plugin section is defined, then the compiledLocale and namespaces are not being passed in to the underline Flex Compiler in the 1st plugin. Looking at your example, the two sections seems to be of the same goal and uses similar configuration. Where as in my scenario, the two executions execute different goal---the first executes compile-swf, and the second executes optimize, and each took drastically different configuration options.




> POM allows duplicate plugin configuration
> -----------------------------------------
>
>                 Key: MNG-4487
>                 URL: http://jira.codehaus.org/browse/MNG-4487
>             Project: Maven 2
>          Issue Type: Improvement
>    Affects Versions: 2.0.9
>            Reporter: Ken Wong
>            Priority: Minor
>         Attachments: MNG-4487.zip
>
>
> I have a project that uses FlexMOJO to compile the swc and then optimize and create a swf. If you look at the following pom extract, you will see that I defined the configuration for the same plugin twice (flexmojos-maven-plugin). There was no error but having the duplicate definition caused maven to be confused and the locale and namespace parameters ended up being 'lost'. If I comment out the 2nd part, then it works. If having duplicate definition confuses maven, it would be nice to have it throw an error when it sees duplicate configuration for the same plugin, instead of yielding confusing result.
> build>
>                 <plugins>
>                         <plugin>
>                                 <groupId>org.sonatype.flexmojos</groupId>
>                                 <artifactId>flexmojos-maven-plugin</artifactId>
>                                 <configuration>
>                                         <compiledLocales>
>                                                 <locale>en_US</locale>
>                                                 <locale>es_ES</locale>
>                                                 <locale>ja_JP</locale>
>                                         </compiledLocales>
> resourceBundlePath>
>                                         <namespaces>
>                                                 <namespace>
>                                                         <uri>http://www.stoneriver.com/2009/uicore</uri>
>                                                         <manifest>${basedir}/src/manifest.xml</manifest>
>                                                 </namespace>
>                                         </namespaces>
>                                         <includeNamespaces>
>                                                 <namespace>http://www.stoneriver.com/2009/uicore</namespace>
>                                         </includeNamespaces>
>                                 </configuration>
>                         </plugin>
>                                  <plugin>
>                                  <groupId>org.sonatype.flexmojos</groupId>
>                                  <artifactId>flexmojos-maven-plugin</artifactId>
>                                  <executions>
>                                  <execution>
>                                  <goals>
>                                  <goal>optimize</goal>
>                                  </goals>
>                                  </execution>
>                                  </executions>
>                                  </plugin>
>  
>                 </plugins> 
> </build>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira