[ http://jira.codehaus.org/browse/MNG-1241?page=all ]
     
John Casey closed MNG-1241:
---------------------------

      Assign To: John Casey
     Resolution: Won't Fix
    Fix Version:     (was: 2.1)
                 2.0.1

Merging collections is problematic, in that there is no way to simply override 
the collection. Instead, we've got an attribute you can specify on any element 
within a plugin's configuration which will direct the inheritance mechanism to 
append the local elements to the parent's. This is good for this use case in 
particular...

Try something like this:

/* PARENT */

        <configuration>

          <excludes>
              <exclude>**/*.xml</exclude>
          </excludes>

        </configuration>                   

/* CHILD */
        <configuration>

          <excludes combine.children="append">
              <exclude>**/*.pom</exclude>
          </excludes>

        </configuration>

This should result in the following:

        <configuration>

          <excludes combine.children="append">
              <exclude>**/*.xml</exclude>
              <exclude>**/*.pom</exclude>
          </excludes>

        </configuration>

which you can check via: 'mvn help:effective-pom'

> configuration collections are not merged when configuration is
> --------------------------------------------------------------
>
>          Key: MNG-1241
>          URL: http://jira.codehaus.org/browse/MNG-1241
>      Project: Maven 2
>         Type: Bug

>   Components: Inheritence and Interpolation
>     Versions: 2.0
>  Environment: jdk 1.4.208, maven 2.0, winxp
>     Reporter: Brian Bonner
>     Assignee: John Casey
>      Fix For: 2.0.1

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