Also skip compiling tests when -Dmaven.test.skip=true is provided.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@292561 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kenney Westerhof 2005-09-29 21:58:01 +00:00
parent c20b2f03b2
commit 790c9621e3
1 changed files with 22 additions and 0 deletions

View File

@ -37,6 +37,14 @@ import java.util.Set;
public class TestCompilerMojo
extends AbstractCompilerMojo
{
/**
* Set this to 'true' to bypass unit tests entirely.
* Its use is NOT RECOMMENDED, but quite convenient on occasion.
*
* @parameter expression="${maven.test.skip}"
*/
private boolean skip;
/**
* The source directories containing the test-source to be compiled.
*
@ -78,6 +86,20 @@ public class TestCompilerMojo
*/
private Set testExcludes = new HashSet();
public void execute()
throws MojoExecutionException
{
if ( skip )
{
getLog().info( "Not compiling test sources" );
return;
}
else
{
super.execute();
}
}
protected List getCompileSourceRoots()
{
return compileSourceRoots;