Author: trygvis
Date: Mon Aug 8 12:58:32 2005
New Revision: 230869
URL: http://svn.apache.org/viewcvs?rev=230869&view=rev
Log:
Resolving http://jira.codehaus.org/browse/MNG-710: "Add ability to fork the
maven-compiler-plugin".
o Applying Rod Coffin's patch. Removed the basedir as a configurable argument.
Modified:
maven/components/trunk/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
Modified:
maven/components/trunk/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java?rev=230869&r1=230868&r2=230869&view=diff
==============================================================================
---
maven/components/trunk/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
(original)
+++
maven/components/trunk/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
Mon Aug 8 12:58:32 2005
@@ -93,6 +93,41 @@
private String compilerId;
/**
+ * Runs the compiler in a separate process.
+ *
+ * If not set the compiler will default to a executable.
+ *
+ * @parameter default-value="false"
+ */
+ private boolean fork;
+
+ /**
+ * The executable of the compiler to use.
+ *
+ * @parameter
+ */
+ private String executable;
+
+ /**
+ * Arguements to be passed to the compiler if fork is set to true.
+ *
+ * This is because the list of valid arguements passed to a Java compiler
+ * varies based on the compiler version.
+ *
+ * @parameter
+ */
+ private List compilerArguements;
+
+ /**
+ * The directory to run the compiler from if fork is true.
+ *
+ * @parameter expression="${basedir}"
+ * @required
+ * @readonly
+ */
+ private File basedir;
+
+ /**
* @parameter
expression="${component.org.codehaus.plexus.compiler.manager.CompilerManager}"
* @required
* @readonly
@@ -137,6 +172,7 @@
if ( staleSources.isEmpty() )
{
getLog().info( "Nothing to compile - all classes are up to date" );
+
return;
}
else
@@ -156,6 +192,14 @@
compilerConfiguration.setSourceEncoding( encoding );
+ compilerConfiguration.setFork( fork );
+
+ compilerConfiguration.setExecutable( executable );
+
+ compilerConfiguration.setWorkingDirectory( basedir );
+
+ compilerConfiguration.setCompilerArguements( compilerArguements );
+
//
----------------------------------------------------------------------
// Dump configuration
//
----------------------------------------------------------------------
@@ -256,8 +300,8 @@
}
catch ( InclusionScanException e )
{
- throw new MojoExecutionException( "Error scanning source root:
\'" + sourceRoot
- + "\' for stale files to recompile.", e );
+ throw new MojoExecutionException( "Error scanning source root:
\'" + sourceRoot + "\' " +
+ "for stale files to
recompile.", e );
}
}
@@ -285,5 +329,4 @@
}
return newCompileSourceRootsList;
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]