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>

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 <hdo...@allshare.nl> 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: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to