mirror of https://github.com/apache/maven.git
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:
parent
c20b2f03b2
commit
790c9621e3
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue