Class TestCompilerMojo

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

@Mojo(name="testCompile", defaultPhase=TEST_COMPILE, threadSafe=true, requiresDependencyResolution=TEST) public class TestCompilerMojo extends AbstractCompilerMojo
Compiles application test sources.
Since:
2.0
  • Field Details

    • skip

      @Parameter(property="maven.test.skip") private boolean skip
      Set this to 'true' to bypass compilation of test sources. Its use is NOT RECOMMENDED, but quite convenient on occasion.
    • compileSourceRoots

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

      @Parameter(defaultValue="${project.build.testOutputDirectory}", required=true, readonly=false) private File outputDirectory
      The directory where compiled test classes go.

      This parameter should only be modified in special cases. See the CompilerMojo.outputDirectory for more information.

      See Also:
    • testIncludes

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

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

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

      @Parameter(property="maven.compiler.testSource") private String testSource
      The -source argument for the test Java compiler.
      Since:
      2.1
    • testTarget

      @Parameter(property="maven.compiler.testTarget") private String testTarget
      The -target argument for the test Java compiler.
      Since:
      2.1
    • testRelease

      @Parameter(property="maven.compiler.testRelease") private String testRelease
      the -release argument for the test Java compiler
      Since:
      3.6
    • testCompilerArguments

      @Parameter private Map<String,String> testCompilerArguments

      Sets the arguments to be passed to test 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.

      Since:
      2.1
    • testCompilerArgument

      @Parameter private String testCompilerArgument

      Sets the unformatted argument string to be passed to test 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.

      Since:
      2.1
    • generatedTestSourcesDirectory

      @Parameter(defaultValue="${project.build.directory}/generated-test-sources/test-annotations") private File generatedTestSourcesDirectory

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

      Since:
      2.2
    • useModulePath

      @Parameter(defaultValue="true") private boolean useModulePath

      When true, uses the module path when compiling with a release or target of 9+ and module-info.java or module-info.class is present. When false, always uses the class path.

      Since:
      3.11
    • testPath

      @Parameter(defaultValue="${project.testClasspathElements}", readonly=true) private List<String> testPath
    • debugFileName

      @Parameter(defaultValue="javac-test") 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
    • pathElements

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

      private Collection<String> classpathElements
    • modulepathElements

      private Collection<String> modulepathElements
  • Constructor Details

    • TestCompilerMojo

      public TestCompilerMojo()
  • Method Details