Class CompilerMojo

java.lang.Object
org.apache.maven.plugin.compiler.AbstractCompilerMojo
org.apache.maven.plugin.compiler.CompilerMojo
All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo

@Mojo(name="compile", defaultPhase="compile") public class CompilerMojo extends AbstractCompilerMojo
Compiles application sources. By default uses the javac compiler of the JDK used to execute Maven. This can be overwritten through Toolchains or parameter AbstractCompilerMojo.compilerId.
Since:
2.0
Author:
Jason van Zyl
See Also:
  • Field Details

    • compileSourceRoots

      @Parameter protected List<String> compileSourceRoots
      The source directories containing the sources to be compiled.
    • projectArtifact

      @Parameter(defaultValue="${project.mainArtifact}", readonly=true, required=true) protected org.apache.maven.api.Artifact projectArtifact
      Projects main artifact.
    • outputDirectory

      @Parameter(defaultValue="${project.build.outputDirectory}", required=true, readonly=true) protected Path outputDirectory
      The directory for compiled classes.
    • includes

      @Parameter protected Set<String> includes
      A list of inclusion filters for the compiler.
    • excludes

      @Parameter protected Set<String> excludes
      A list of exclusion filters for the compiler.
    • incrementalExcludes

      @Parameter protected Set<String> incrementalExcludes
      A list of exclusion filters for the incremental calculation.
      Since:
      3.11
    • generatedSourcesDirectory

      @Parameter(defaultValue="${project.build.directory}/generated-sources/annotations") protected Path generatedSourcesDirectory

      Specify where to place generated source files created by annotation processing. Only applies to JDK 1.6+

      Since:
      2.2
    • skipMain

      @Parameter(property="maven.main.skip") protected boolean skipMain
      Set this to true to bypass compilation of main sources. Its use is NOT RECOMMENDED, but quite convenient on occasion.
    • compilePath

      @Parameter protected List<String> compilePath
    • multiReleaseOutput

      @Parameter protected boolean multiReleaseOutput

      When set to true, the classes will be placed in META-INF/versions/${release} The release value must be set, otherwise the plugin will fail.

      Note: A jar is only a multirelease jar if META-INF/MANIFEST.MF contains Multi-Release: true. You need to set this by configuring the maven-jar-plugin. This implies that you cannot test a multirelease jar using the outputDirectory.
      Since:
      3.7.1
    • debugFileName

      @Parameter(defaultValue="javac") protected String debugFileName
      When both AbstractCompilerMojo.fork and AbstractCompilerMojo.debug are enabled the commandline arguments used will be dumped to this file.
      Since:
      3.10.0
  • Constructor Details

    • CompilerMojo

      public CompilerMojo()
  • Method Details