From c6978405cfe598a8338bb9ee70f6e19792b906a7 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Sat, 12 Mar 2005 06:10:37 +0000 Subject: [PATCH] add source and target git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163535 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/plugin/CompilerMojo.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java index 8effbdef8d..f296fa09bd 100644 --- a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java +++ b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java @@ -57,6 +57,8 @@ import java.util.List; * expression="#maven.compiler.debug" * description="Whether to include debugging information in the compiled class files; the default value is false" * @todo change debug parameter type to Boolean + * @parameter name="source" type="String" required="false" expression="#source" validator="" description="The -source argument for the Java compiler" + * @parameter name="target" type="String" required="false" expression="#target" validator="" description="The -target argument for the Java compiler" */ public class CompilerMojo @@ -95,6 +97,18 @@ public class CompilerMojo compilerConfiguration.setOutputLocation( outputDirectory ); compilerConfiguration.setClasspathEntries( classpathElements ); compilerConfiguration.setSourceLocations( compileSourceRoots ); + + String source = ( String ) request.getParameter( "source" ); + if ( source != null ) + { + compilerConfiguration.addCompilerOption( "-source", source ); + } + + String target = ( String ) request.getParameter( "target" ); + if ( target != null ) + { + compilerConfiguration.addCompilerOption( "-target", target ); + } /* Compile with debugging info */ String debugAsString = (String) request.getParameter( "debug" );