mirror of https://github.com/apache/maven.git
o Adding parameters:
- Show deprecation - Show warnings o Using the setters on the configuration object instead of passing them in their raw format (eg -target 1.1). git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@230547 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b1b01a6c94
commit
b4cbc02567
|
@ -44,6 +44,20 @@ public abstract class AbstractCompilerMojo
|
|||
*/
|
||||
private boolean debug;
|
||||
|
||||
/**
|
||||
* Output source locations where deprecated APIs are used
|
||||
*
|
||||
* @parameter
|
||||
*/
|
||||
private boolean showDeprecation;
|
||||
|
||||
/**
|
||||
* Output warnings
|
||||
*
|
||||
* @parameter
|
||||
*/
|
||||
private boolean showWarnings;
|
||||
|
||||
/**
|
||||
* The -source argument for the Java compiler
|
||||
*
|
||||
|
@ -130,23 +144,18 @@ public abstract class AbstractCompilerMojo
|
|||
compilerConfiguration.setSourceFiles( staleSources );
|
||||
}
|
||||
|
||||
if ( source != null )
|
||||
{
|
||||
compilerConfiguration.addCompilerOption( "-source", source );
|
||||
}
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
compilerConfiguration.addCompilerOption( "-target", target );
|
||||
}
|
||||
|
||||
if ( encoding != null )
|
||||
{
|
||||
compilerConfiguration.addCompilerOption( "-encoding" , encoding );
|
||||
}
|
||||
|
||||
compilerConfiguration.setDebug( debug );
|
||||
|
||||
compilerConfiguration.setShowDeprecation( showDeprecation );
|
||||
|
||||
compilerConfiguration.setShowWarnings( showWarnings );
|
||||
|
||||
compilerConfiguration.setSourceVersion( source );
|
||||
|
||||
compilerConfiguration.setTargetVersion( target );
|
||||
|
||||
compilerConfiguration.setSourceEncoding( encoding );
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Dump configuration
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -189,7 +198,7 @@ public abstract class AbstractCompilerMojo
|
|||
throw new MojoExecutionException( "No such compiler '" + e.getCompilerId() + "'." );
|
||||
}
|
||||
|
||||
getLog().info( "Using compiler '" + compilerId + "'." );
|
||||
getLog().debug( "Using compiler '" + compilerId + "'." );
|
||||
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue