compiler:compile

Compiles application sources

Mojo Attributes:

  • Requires a Maven 2.0 project to execute.
  • Requires dependency resolution of artifacts in scope: compile
  • Automatically executes within the lifecycle phase: compile

Optional Parameters

Name Type Description
compilerArgument String Sets the unformatted argument string to be passed to the compiler if fork is set to true. This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.
compilerArguments Map

Sets the arguments to be passed to the compiler (prepending a dash) if fork is set to true.

This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.

compilerId String The compiler id of the compiler to use. See this guide for more information. Default value is javac.
compilerManager CompilerManager Plexus compiler manager.
compilerVersion String Version of the compiler to use, ex. "1.3", "1.5", if fork is set to true.
debug boolean Set to true to include debugging information in the compiled class files. Default value is true.
encoding String The -encoding argument for the Java compiler.
excludes Set A list of exclusion filters for the compiler.
executable String Sets the executable of the compiler to use when fork is true.
failOnError boolean Indicates whether the build will continue even if there are compilation errors; defaults to true. Default value is true.
fork boolean Allows running the compiler in a separate process. If "false" it uses the built in compiler, while if "true" it will use an executable. Default value is false.
includes Set A list of inclusion filters for the compiler.
maxmem String Sets the maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" if fork is set to true.
meminitial String Initial size, in megabytes, of the memory allocation pool, ex. "64", "64m" if fork is set to true.
optimize boolean Set to true to optimize the compiled code using the compiler's optimization methods. Default value is false.
outputFileName String Sets the name of the output file when compiling a set of sources to a single file.
showDeprecation boolean Sets whether to show source locations where deprecated APIs are used. Default value is false.
showWarnings boolean Set to true to show compilation warnings. Default value is false.
source String The -source argument for the Java compiler.
staleMillis int Sets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation. Default value is 0.
target String The -target argument for the Java compiler.
verbose boolean Set to true to show messages about what the compiler is doing. Default value is false.

Parameter Details

compilerArgument

Sets the unformatted argument string to be passed to the compiler if fork is set to true.

This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.

  • Type: java.lang.String
  • Required: No

compilerArguments Sets the arguments to be passed to the compiler (prepending a dash) if fork is set to true.

This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.

  • Type: java.util.Map
  • Required: No

compilerId The compiler id of the compiler to use. See this guide for more information.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.compiler.compilerId}
  • Default: javac

compilerManager Plexus compiler manager.
  • Type: org.codehaus.plexus.compiler.manager.CompilerManager
  • Required: No

compilerVersion Version of the compiler to use, ex. "1.3", "1.5", if fork is set to true.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.compiler.compilerVersion}

debug Set to true to include debugging information in the compiled class files.
  • Type: boolean
  • Required: No
  • Expression: ${maven.compiler.debug}
  • Default: true

encoding The -encoding argument for the Java compiler.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.compiler.encoding}

excludes A list of exclusion filters for the compiler.
  • Type: java.util.Set
  • Required: No

executable Sets the executable of the compiler to use when fork is true.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.compiler.executable}

failOnError Indicates whether the build will continue even if there are compilation errors; defaults to true.
  • Type: boolean
  • Required: No
  • Expression: ${maven.compiler.failOnError}
  • Default: true

fork Allows running the compiler in a separate process. If "false" it uses the built in compiler, while if "true" it will use an executable.
  • Type: boolean
  • Required: No
  • Default: false

includes A list of inclusion filters for the compiler.
  • Type: java.util.Set
  • Required: No

maxmem Sets the maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" if fork is set to true.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.compiler.maxmem}

meminitial Initial size, in megabytes, of the memory allocation pool, ex. "64", "64m" if fork is set to true.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.compiler.meminitial}

optimize Set to true to optimize the compiled code using the compiler's optimization methods.
  • Type: boolean
  • Required: No
  • Expression: ${maven.compiler.optimize}
  • Default: false

outputFileName Sets the name of the output file when compiling a set of sources to a single file.
  • Type: java.lang.String
  • Required: No
  • Expression: ${project.build.finalName}

showDeprecation Sets whether to show source locations where deprecated APIs are used.
  • Type: boolean
  • Required: No
  • Expression: ${maven.compiler.showDeprecation}
  • Default: false

showWarnings Set to true to show compilation warnings.
  • Type: boolean
  • Required: No
  • Expression: ${maven.compiler.showWarnings}
  • Default: false

source The -source argument for the Java compiler.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.compiler.source}

staleMillis Sets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
  • Type: int
  • Required: No
  • Expression: ${lastModGranularityMs}
  • Default: 0

target The -target argument for the Java compiler.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.compiler.target}

verbose Set to true to show messages about what the compiler is doing.
  • Type: boolean
  • Required: No
  • Expression: ${maven.compiler.verbose}
  • Default: false