Class CompilerMojo

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

@Mojo(name="compile", defaultPhase=COMPILE, threadSafe=true, requiresDependencyResolution=COMPILE) public class CompilerMojo extends AbstractCompilerMojo
Compiles application sources
Since:
2.0
  • Field Details

    • compileSourceRoots

      @Parameter(defaultValue="${project.compileSourceRoots}", readonly=false, required=true) private List<String> compileSourceRoots
      The source directories containing the sources to be compiled.
    • outputDirectory

      @Parameter(property="maven.compiler.outputDirectory", defaultValue="${project.build.outputDirectory}", required=true, readonly=false) private File outputDirectory
      The directory for compiled classes.

      This parameter should only be modified in special cases. One example is creating a multi-release jar with a lower bytecode level (i.e. setting it to ${project.build.outputDirectory}/META-INF/versions/21 or similar) in an additional execution.

      When the required bytecode level is available though an installed JDK or toolchain, it is recommended to use the <release> property in conjunction with the ${multiReleaseOutput} parameter instead.

    • projectArtifact

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

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

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

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

      @Parameter(defaultValue="${project.build.directory}/generated-sources/annotations") private File 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") private boolean skipMain
      Set this to 'true' to bypass compilation of main sources. Its use is NOT RECOMMENDED, but quite convenient on occasion.
    • compilePath

      @Parameter(defaultValue="${project.compileClasspathElements}", readonly=true, required=true) private List<String> compilePath
    • multiReleaseOutput

      @Parameter private 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") private String debugFileName
      when forking and debug activated the commandline used will be dumped in this file
      Since:
      3.10.0
    • locationManager

      final org.codehaus.plexus.languages.java.jpms.LocationManager locationManager
    • classpathElements

      private List<String> classpathElements
    • modulepathElements

      private List<String> modulepathElements
    • pathElements

      private Map<String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> pathElements
  • Constructor Details

    • CompilerMojo

      public CompilerMojo()
  • Method Details