From f37561b2e3df14406c3944901a8e7102e58f8669 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 22 Jul 2005 15:57:10 +0000 Subject: [PATCH] PR: MNG-595 Submitted by: Jesse McConnell Reviewed by: Brett Porter add support for -encoding flag to javac git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@220765 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/plugin/AbstractCompilerMojo.java | 12 ++++++++++++ .../maven/plugin/CompilationFailureException.java | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) 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 3cb0b679ea..4b16b9823a 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 @@ -59,6 +59,13 @@ public abstract class AbstractCompilerMojo * @parameter */ private String target; + + /** + * The -encoding argument for the Java compiler + * + * @parameter + */ + private String encoding; /** * The granularity in milliseconds of the last modification @@ -117,6 +124,11 @@ public abstract class AbstractCompilerMojo compilerConfiguration.addCompilerOption( "-target", target ); } + if ( encoding != null ) + { + compilerConfiguration.addCompilerOption( "-encoding" , encoding ); + } + compilerConfiguration.setDebug( debug ); List messages = null; diff --git a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilationFailureException.java b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilationFailureException.java index d4861eccc0..9f63ab509d 100644 --- a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilationFailureException.java +++ b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilationFailureException.java @@ -30,7 +30,6 @@ public class CompilationFailureException sb.append( compilerError ).append( LS ); } - return sb.toString(); } }