Multiple profiles are not merging properly if the same configuration element is 
used
------------------------------------------------------------------------------------

         Key: MNG-1241
         URL: http://jira.codehaus.org/browse/MNG-1241
     Project: Maven 2
        Type: Bug
  Components: maven-project  
    Versions: 2.0    
 Environment: jdk 1.4.208, maven 2.0, winxp
 Reporter: Brian Bonner


I wanted to use profiles to configure the eclipse plugin based upon how a user 
had eclipse configured (i.e. WTP, Sysdeo, version of Eclipse, etc.)
I'm hoping this is a valid use for profiles.  I ran into a problem when trying 
it at first it looked like the merge was not happening.  

If I specified:

<classpathContainers>                                                           
  
    <java.lang.String>Using Eclipse31</java.lang.String>
</classpathContainers>

in an Eclipse31 profile  and

<classpathContainers>                                                           
  
    <java.lang.String>Using WTP</java.lang.String>
</classpathContainers>

in a WTP profile

and then activated both profiles, I end up with only the Ecipse 31 profile.

If I specify different elements inside of a configuration (i.e. 
classpathContainers in one and buildspec in another), it works, but not if I 
specify "same" element.

i.e. if I use:

   <profile>
                       <!--  Build Profile for Eclipse WTP -->
                       <id>eclipse</id>
                       <activation>
                               <property>
                                       <name>eclipse31wtp</name>
                                       <value>true</value>
                               </property>
                       </activation>
                       <build>
                               <plugins>
                                       <plugin>
                                             
<groupId>org.apache.maven.plugins</groupId>
                                             
<artifactId>maven-eclipse-plugin</artifactId>
                                               <configuration>
                                                       <classpathContainers>
                                                             
<java.lang.String>Using Eclipse31</java.lang.String>
                                                       </classpathContainers>
                                               </configuration>
                                       </plugin>
                               </plugins>
                       </build>
               </profile>

                                                       <profile>
                       <!--  Build Profile for Eclipse WTP -->
                       <id>wtp</id>
                       <activation>
                               <property>
                                       <name>wtp</name>
                                       <value>true</value>
                               </property>
                       </activation>
                       <build>
                               <plugins>
                                       <plugin>
                                             
<groupId>org.apache.maven.plugins</groupId>
                                             
<artifactId>maven-eclipse-plugin</artifactId>
                                               <configuration>
                                                       <buildcommands>
                                                             
<java.lang.String>WTP</java.lang.String>
                                                       </buildcommands>
                                               </configuration>
                                       </plugin>
                               </plugins>
                       </build>
               </profile>

I get an effective-pom that has classpath from Eclipse31 and
buildcommands from WTP.

Not exactly what I was hoping for.  I hope this is a bug.


-- 
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


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

Reply via email to