On 7 April 2011 12:08, Stephen Connolly <[email protected]> wrote:
> still bad...
>
> i'm going to guess that you defined the plugin twice, e.g.
>
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> ...
> </plugin>
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> ...
> </plugin>

Forgot to mention... I can conclude you are using Maven 2.x... Maven
3.x will tell you to take a long walk off a short pier if you attempt
to duplicate the same plugin in the pom.

Maven 2.x will just merge the two which is why the last one wins for you
>
> instead of adding an extra execution to the plugin
>
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <executions>
>  <execution>
>    <id>ora</id>
>    <configuration>
>      ...
>    </configuration>
>  </execution>
>  <execution>
>    <id>mssql</id>
>    <configuration>
>      ...
>    </configuration>
>  </execution>
> </execution>
> </plugin>
>
> Now you should note that the above will run the tests three times!
> (there is a default execution of the plugin)
>
> In Maven 3.x you can disable the default execution with
>
>          <execution>
>            <id>default-test</id>
>            <configuration>
>              <skipTests>true</skipTests>
>            </configuration>
>          </execution>
>
> That won't work for Maven 2.x so if you need to support building with
> Maven 2.x then you either define one execution's configuration in the
> plugin configuration and reset the configuration back in the second
> configuration (i.e. you only have one execution defined in your pom)
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
>    <!-- by default use ora config -->
>    <configuration>
>      ...
>    </configuration>
> <executions>
>  <execution> <!-- add one execution for mssql -->
>    <id>mssql</id>
>    <configuration>
>      ...
>    </configuration>
>  </execution>
> </execution>
> </plugin>
>
> or you do something like
>
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <configuration>
>  <skipTests>true</skipTests>
> </configuration>
> <executions>
>  <execution>
>    <id>ora</id>
>    <configuration>
>      <skipTests>${skipTests}</skipTests>
>      ...
>    </configuration>
>  </execution>
>  <execution>
>    <id>mssql</id>
>    <configuration>
>      <skipTests>${skipTests}</skipTests>
>      ...
>    </configuration>
>  </execution>
> </execution>
> </plugin>
>
> which will disable surefire by default and re-enable it based on the
> skipTests property for the two executions.
>
> On 7 April 2011 10:55, Hugo de Oude <[email protected]> wrote:
>> Oh I'm sorry. I tried to correct the problem and hopefully it is ok now?
>>
>> --
>> View this message in context: 
>> http://maven.40175.n5.nabble.com/Maven-surefire-plugin-run-twice-with-different-argLine-setttings-tp4288014p4288110.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to