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 2008/02/20 22:58:22 UTC
svn commit: r629628 - in /maven/plugins/trunk/maven-compiler-plugin/src:
it/test1/pom.xml main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
Author: olamy
Date: Wed Feb 20 13:58:21 2008
New Revision: 629628
URL: http://svn.apache.org/viewvc?rev=629628&view=rev
Log:
[MCOMPILER-52] Need a way to specify the debug level
Submitted by Thomas Krammer
Modified:
maven/plugins/trunk/maven-compiler-plugin/src/it/test1/pom.xml
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/test1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/test1/pom.xml?rev=629628&r1=629627&r2=629628&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/test1/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/test1/pom.xml Wed Feb 20 13:58:21 2008
@@ -39,6 +39,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
+ <debuglevel>source,lines,vars</debuglevel>
</configuration>
</plugin>
</plugins>
Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java?rev=629628&r1=629627&r2=629628&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java Wed Feb 20 13:58:21 2008
@@ -216,6 +216,15 @@
* @parameter expression="${project.build.finalName}"
*/
private String outputFileName;
+
+ /**
+ * Keyword list to be appended to the -g command-line switch. Legal values are none or a comma-separated list of the following keywords: lines, vars, and source.
+ * If debuglevel is not specified, by default, nothing will be appended to -g. If debug is not turned on, this attribute will be ignored.
+ *
+ * @parameter expression="${maven.compiler.debuglevel}"
+ * @since 2.1
+ */
+ private String debuglevel;
// ----------------------------------------------------------------------
// Read-only parameters
@@ -314,6 +323,21 @@
compilerConfiguration.setDebug( debug );
+ if ( debug && StringUtils.isNotEmpty( debuglevel ) )
+ {
+ String[] split = StringUtils.split( debuglevel, "," );
+ for ( int i = 0; i < split.length; i++ )
+ {
+ if ( !( split[i].equalsIgnoreCase( "none" ) || split[i].equalsIgnoreCase( "lines" )
+ || split[i].equalsIgnoreCase( "vars" ) || split[i].equalsIgnoreCase( "source" ) ) )
+ {
+ throw new IllegalArgumentException( "The specified debug level: '" + split[i]
+ + "' is unsupported. " + "Legal values are 'none', 'lines', 'vars', and 'source'." );
+ }
+ }
+ compilerConfiguration.setDebugLevel( debuglevel );
+ }
+
compilerConfiguration.setVerbose( verbose );
compilerConfiguration.setShowWarnings( showWarnings );