From 3068a0259cd1e99aa217428a3bd67f39f5844906 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Sat, 15 Oct 2005 14:42:19 +0000 Subject: [PATCH] make sure compiler warnings are output git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@321340 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/AbstractCompilerMojo.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java index c63db84bbe..54a04b870a 100644 --- a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java +++ b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java @@ -60,9 +60,10 @@ public abstract class AbstractCompilerMojo * The default value is true. * * @parameter expression="${maven.compiler.debug}" default-value="true" + * @deprecated */ private boolean debug; - + /** * Whether to output messages about what the compiler is doing * @@ -83,7 +84,7 @@ public abstract class AbstractCompilerMojo * @parameter default-value="false" */ private boolean optimize; - + /** * Output warnings * @@ -260,11 +261,11 @@ public abstract class AbstractCompilerMojo compilerConfiguration.setClasspathEntries( getClasspathElements() ); compilerConfiguration.setSourceLocations( compileSourceRoots ); - + compilerConfiguration.setOptimize( optimize ); compilerConfiguration.setDebug( debug ); - + compilerConfiguration.setVerbose( verbose ); compilerConfiguration.setShowWarnings( showWarnings ); @@ -390,6 +391,15 @@ public abstract class AbstractCompilerMojo { throw new CompilationFailureException( messages ); } + else + { + for ( Iterator i = messages.iterator(); i.hasNext(); ) + { + CompilerError message = (CompilerError) i.next(); + + getLog().warn( message.toString() ); + } + } } private Set computeStaleSources( CompilerConfiguration compilerConfiguration, Compiler compiler,