You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2013/02/03 01:11:50 UTC

svn commit: r1441839 - /maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java

Author: olamy
Date: Sun Feb  3 00:11:50 2013
New Revision: 1441839

URL: http://svn.apache.org/viewvc?rev=1441839&view=rev
Log:
[MCOMPILER-132] Provide general "maven.compiler.skip" attribute

Modified:
    maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java

Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java?rev=1441839&r1=1441838&r2=1441839&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java Sun Feb  3 00:11:50 2013
@@ -96,6 +96,12 @@ public class CompilerMojo
     @Parameter( defaultValue = "${project.build.directory}/generated-sources/annotations" )
     private File generatedSourcesDirectory;
 
+    /**
+     * Set this to 'true' to bypass compilation of main sources.
+     * Its use is NOT RECOMMENDED, but quite convenient on occasion.
+     */
+    @Parameter ( property = "maven.compiler.main.skip" )
+    private boolean skip;
 
     protected List<String> getCompileSourceRoots()
     {
@@ -115,6 +121,11 @@ public class CompilerMojo
     public void execute()
         throws MojoExecutionException, CompilationFailureException
     {
+        if ( skip )
+        {
+            getLog().info( "Not compiling test sources" );
+            return;
+        }
         super.execute();
 
         if ( outputDirectory.isDirectory() )