Hi Martin,
Just to let you know, it doesn't work for multi-module projects. Here are the
steps I have followed:
1) edit parent pom to contains:
<build>
<pluginManagement>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>failsafe-maven-plugin</artifactId>
<version>2.4.3-alpha-1</version>
<configuration>
<includes><include>**/*.java</include></includes>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
<phase>test</phase>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
<phase>deploy</phase><!-- This is to override default
execution on verify phase -->
</execution>
</executions>
</plugin>
</plugins>
</build>
2) run
mvn clean install site failsafe:verify
The issue is that the first module that has test failure will stop the build so
following modules in the reactor will not have their site generated.
++
Julien
________________________________
De : Martin Höller <[email protected]>
À : [email protected]
Envoyé le : Jeudi, 13 Août 2009, 11h00mn 06s
Objet : Re: Build planification ignore/fail on test produce unexpected result
On Thursday 13 August 2009 Julien HENRY wrote:
> If I understand the failsafe plugin documentation and your suggestion, it
> means failing the build during the verify phase instead of test phase.
>
> So I will try something like:
> 1)
> configure failsafe plugin to be attached to the test phase instead of
> the integration-test one
ACK
> 2) disable surefire
ACK
> 3) mvn clean post-integration-test site site-deploy sonar:sonar install
> verify
Not 'verify' but 'failsafe:verify'. Or configure the failsafe:verify goal to
be executed in some phase like verify.
> Anyway I can already tell I don't like this solution as it smells too
> much a hack for me and it will make it harder for my users to understand
> the purpose of all this mess.
Well, I'm afraid you either have to live with it, or enhance surefire (which
would be the nicest option).
> What a pity there is no separate verify goal on the surefire plugin...
Maybe you should search surefire's JIRA for related issues. I think I
remember a similar discussion on the maven-user list some time ago.
hth,
- martin