[MNG-562] Add ignore failures

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@209803 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2005-07-08 14:53:06 +00:00
parent 2a1a7c3808
commit 6f62ddc456
2 changed files with 23 additions and 2 deletions

View File

@ -34,4 +34,10 @@
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<contributors>
<contributor>
<name>Joakim Erdfelt</name>
<email>joakim@erdfelt.com</email>
</contributor>
</contributors>
</project> </project>

View File

@ -46,10 +46,16 @@ public class SurefirePlugin
{ {
/** /**
* Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion. * Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.
* @parameter expression=${maven.test.skip}" *
* @parameter expression="${maven.test.skip}"
*/ */
private boolean skip; private boolean skip;
/**
* @parameter expression="${maven.test.failure.ignore}"
*/
private boolean testFailureIgnore = false;
/** /**
* @parameter expression="${basedir}" * @parameter expression="${basedir}"
* @required * @required
@ -238,7 +244,16 @@ public class SurefirePlugin
if ( !success ) if ( !success )
{ {
throw new MojoExecutionException( "There are some test failures." ); String msg = "There are some test failure.";
if ( testFailureIgnore )
{
getLog().error( msg );
}
else
{
throw new MojoExecutionException( msg );
}
} }
} }