I see the problem now.

Since there is no <id> block BOTH the build.plugin and the profile
section have the same id of "default".
Hence when -Prun-its is on, the profile section overwrites the
build.plugin section.
(Special thanks to help:effective-pom).

Since the point of the run-its profile is to run an additional
surefire test for the integration tests, both executions need a
different id.

The other problem was that the build.plugin section was missing
<goals> which meant that it wasn't actually configuring anything.

The last problem is that having the same elements in the plugin's
configuration section as the execution's configuration section means
that the execution's configuration overwrites the values.
So you need to use the combine.children="append" black magic.

The working pom stanza is:

     <plugin>
       <artifactId>maven-surefire-plugin</artifactId>
       <executions>
         <execution>
           <id>test</id>
           <phase>test</phase>
           <goals>
             <goal>test</goal>
           </goals>
           <configuration>
             <includes>
               <include>**/*Test.java</include>
             </includes>
             <excludes combine.children="append">
               <exclude>**/projects/**</exclude>
             </excludes>
           </configuration>
         </execution>
       </executions>
       <configuration>
         <excludes>
           <exclude>**/Abstract*.java</exclude>
           <exclude>**/InstallPluginsMojoTest.java</exclude>
         </excludes>
         <systemProperties>
           <property>
             <name>maven.home</name>
             <value>${maven.home}</value>
           </property>
         </systemProperties>
         <argLine>${maven.test.jvmargs}</argLine>
       </configuration>
     </plugin>
...
   <profile>
     <id>run-its</id>
     <build>
       <plugins>
         <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
           <executions>
             <execution>
               <id>integration-test</id>
               <phase>integration-test</phase>
               <goals>
                 <goal>test</goal>
               </goals>
               <configuration>
                 <includes>
                   <include>**/*IT.java</include>
                 </includes>
               </configuration>
             </execution>
           </executions>
         </plugin>

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

Reply via email to