Skip to content

Commit b8edae1

Browse files
committedAug 20, 2010
1 parent 1c78940 commit b8edae1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed
 

‎maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java

+12-8
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ public class SurefireArchiver extends MavenReporter {
6262

6363
public boolean preExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener) throws InterruptedException, IOException {
6464
if (isSurefireTest(mojo)) {
65-
// tell surefire:test to keep going even if there was a failure,
66-
// so that we can record this as yellow.
67-
// note that because of the way Maven works, just updating system property at this point is too late
68-
XmlPlexusConfiguration c = (XmlPlexusConfiguration) mojo.configuration.getChild("testFailureIgnore");
69-
if(c!=null && c.getValue().equals("${maven.test.failure.ignore}") && System.getProperty("maven.test.failure.ignore")==null)
70-
c.setValue("true");
65+
if (!mojo.is("org.apache.maven.plugins", "maven-failsafe-plugin", "integration-test")) {
66+
// tell surefire:test to keep going even if there was a failure,
67+
// so that we can record this as yellow.
68+
// note that because of the way Maven works, just updating system property at this point is too late
69+
XmlPlexusConfiguration c = (XmlPlexusConfiguration) mojo.configuration.getChild("testFailureIgnore");
70+
if(c!=null && c.getValue().equals("${maven.test.failure.ignore}") && System.getProperty("maven.test.failure.ignore")==null)
71+
c.setValue("true");
72+
}
7173
}
7274
return true;
7375
}
@@ -78,7 +80,8 @@ public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo moj
7880
listener.getLogger().println(Messages.SurefireArchiver_Recording());
7981

8082
File reportsDir;
81-
if (mojo.is("org.apache.maven.plugins", "maven-surefire-plugin", "test")) {
83+
if (mojo.is("org.apache.maven.plugins", "maven-surefire-plugin", "test") ||
84+
mojo.is("org.apache.maven.plugins", "maven-failsafe-plugin", "integration-test")) {
8285
try {
8386
reportsDir = mojo.getConfigurationValue("reportsDirectory", File.class);
8487
} catch (ComponentConfigurationException e) {
@@ -158,7 +161,8 @@ public Collection<? extends Action> getProjectActions(MavenModule module) {
158161

159162
private boolean isSurefireTest(MojoInfo mojo) {
160163
if ((!mojo.is("com.sun.maven", "maven-junit-plugin", "test"))
161-
&& (!mojo.is("org.apache.maven.plugins", "maven-surefire-plugin", "test")))
164+
&& (!mojo.is("org.apache.maven.plugins", "maven-surefire-plugin", "test"))
165+
&& (!mojo.is("org.apache.maven.plugins", "maven-failsafe-plugin", "integration-test")))
162166
return false;
163167

164168
try {

0 commit comments

Comments
 (0)
Please sign in to comment.