public SurefireArchiver newAutoInstance(MavenModule module) { return new SurefireArchiver(); } }
public MavenBuild(MavenModule project, File buildDir) throws IOException { super(project, buildDir); SurefireArchiver.fixUp(projectActionReporters); }
boolean isTestMojo(MojoInfo mojo) { return getTestMojo(mojo) != null; }
public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, final BuildListener listener, Throwable error) throws InterruptedException, IOException { TestMojo testMojo = getTestMojo(mojo); if (testMojo == null) return true; rememberCheckedFiles(fileSet); markBuildAsSuccess(error,build.getMavenBuildInformation()); hasTestFailures.set(true);
public boolean preExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener) throws InterruptedException, IOException { if (isSurefireTest(mojo)) { if (!mojo.is("org.apache.maven.plugins", "maven-failsafe-plugin", "integration-test")) { // tell surefire:test to keep going even if there was a failure, // so that we can record this as yellow. // note that because of the way Maven works, just updating system property at this point is too late XmlPlexusConfiguration c = (XmlPlexusConfiguration) mojo.configuration.getChild("testFailureIgnore"); if(c!=null && c.getValue().equals("${maven.test.failure.ignore}") && System.getProperty("maven.test.failure.ignore")==null) { if (maven3orLater( build.getMavenBuildInformation().getMavenVersion() )) { String fieldName = "testFailureIgnore"; if (mojo.mojoExecution.getConfiguration().getChild( fieldName ) != null) { mojo.mojoExecution.getConfiguration().getChild( fieldName ).setValue( Boolean.TRUE.toString() ); } else { Xpp3Dom child = new Xpp3Dom( fieldName ); child.setValue( Boolean.TRUE.toString() ); mojo.mojoExecution.getConfiguration().addChild( child ); } } else { c.setValue(Boolean.TRUE.toString()); } } } } return true; }
public boolean preExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener) throws InterruptedException, IOException { if (isTestMojo(mojo)) { // tell test mojo to keep going even if there was a failure, // so that we can record this as yellow. // note that because of the way Maven works, just updating system property at this point is too late // Many test plugins have - as surefire - a configuration key 'testFailureIgnore' which defaults to // ${maven.test.failure.ignore}, so just try that one and change value to true, // if it's still at that default: XmlPlexusConfiguration c = (XmlPlexusConfiguration) mojo.configuration.getChild("testFailureIgnore",false); if(c!=null && c.getValue() != null && c.getValue().equals("${maven.test.failure.ignore}") && System.getProperty("maven.test.failure.ignore")==null) { if (build.getMavenBuildInformation().isMaven3OrLater()) { String fieldName = "testFailureIgnore"; if (mojo.mojoExecution.getConfiguration().getChild( fieldName ) != null) { mojo.mojoExecution.getConfiguration().getChild( fieldName ).setValue( Boolean.TRUE.toString() ); } else { Xpp3Dom child = new Xpp3Dom( fieldName ); child.setValue( Boolean.TRUE.toString() ); mojo.mojoExecution.getConfiguration().addChild( child ); } } else { c.setValue(Boolean.TRUE.toString()); } } } return true; }
public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, final BuildListener listener, Throwable error) throws InterruptedException, IOException { if (!isSurefireTest(mojo)) return true;
public MavenBuild(MavenModule project, File buildDir) throws IOException { super(project, buildDir); SurefireArchiver.fixUp(projectActionReporters); }
public SurefireArchiver newAutoInstance(MavenModule module) { return new SurefireArchiver(); } }