Class TestCompilerMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection
<String> The source directories containing the test-source to be compiled.private String
when forking and debug activated the commandline used will be dumped in this fileprivate File
Specify where to place generated source files created by annotation processing.(package private) final org.codehaus.plexus.languages.java.jpms.LocationManager
private Collection
<String> private File
The directory where compiled test classes go.private boolean
Set this to 'true' to bypass compilation of test sources.private String
Sets the unformatted argument string to be passed to test compiler if fork is set to true.Sets the arguments to be passed to test compiler (prepending a dash) if fork is set to true.A list of exclusion filters for the compiler.A list of inclusion filters for the compiler.A list of exclusion filters for the incremental calculation.private String
the -release argument for the test Java compilerprivate String
The -source argument for the test Java compiler.private String
The -target argument for the test Java compiler.private boolean
Whentrue
, uses the module path when compiling with a release or target of 9+ and module-info.java or module-info.class is present.Fields inherited from class org.apache.maven.plugin.compiler.AbstractCompilerMojo
compilerArgs, compilerArgument, compilerArguments, DEFAULT_SOURCE, DEFAULT_TARGET, MODULE_INFO_TARGET, PS, release, source, target
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
protected String
protected String
protected File
protected File
protected String
protected String
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner
getSourceInclusionScanner
(int staleMillis) protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner
getSourceInclusionScanner
(String inputFileEnding) protected String
protected boolean
protected void
preparePaths
(Set<File> sourceFiles) Methods inherited from class org.apache.maven.plugin.compiler.AbstractCompilerMojo
getBuildStartTime, getImplicit, getModuleDeclaration, getProject, getRequestThreadCount, getToolchain, isDependencyChanged, setRelease, setTarget
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
skip
@Parameter(property="maven.test.skip") private boolean skipSet 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> compileSourceRootsThe source directories containing the test-source to be compiled. -
outputDirectory
@Parameter(defaultValue="${project.build.testOutputDirectory}", required=true, readonly=false) private File outputDirectoryThe 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
A list of inclusion filters for the compiler. -
testExcludes
A list of exclusion filters for the compiler. -
testIncrementalExcludes
A list of exclusion filters for the incremental calculation.- Since:
- 3.11
-
testSource
The -source argument for the test Java compiler.- Since:
- 2.1
-
testTarget
The -target argument for the test Java compiler.- Since:
- 2.1
-
testRelease
the -release argument for the test Java compiler- Since:
- 3.6
-
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
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 generatedTestSourcesDirectorySpecify 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 useModulePathWhen
true
, uses the module path when compiling with a release or target of 9+ and module-info.java or module-info.class is present. Whenfalse
, always uses the class path.- Since:
- 3.11
-
testPath
-
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
-
classpathElements
-
modulepathElements
-
-
Constructor Details
-
TestCompilerMojo
public TestCompilerMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, CompilationFailureException- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Overrides:
execute
in classAbstractCompilerMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
CompilationFailureException
-
getCompileSourceRoots
- Specified by:
getCompileSourceRoots
in classAbstractCompilerMojo
-
getPathElements
protected Map<String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> getPathElements()- Specified by:
getPathElements
in classAbstractCompilerMojo
-
getClasspathElements
- Specified by:
getClasspathElements
in classAbstractCompilerMojo
-
getModulepathElements
- Specified by:
getModulepathElements
in classAbstractCompilerMojo
-
getOutputDirectory
- Specified by:
getOutputDirectory
in classAbstractCompilerMojo
-
preparePaths
- Specified by:
preparePaths
in classAbstractCompilerMojo
-
getSourceInclusionScanner
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(int staleMillis) - Specified by:
getSourceInclusionScanner
in classAbstractCompilerMojo
-
getSourceInclusionScanner
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(String inputFileEnding) - Specified by:
getSourceInclusionScanner
in classAbstractCompilerMojo
-
getSource
- Specified by:
getSource
in classAbstractCompilerMojo
-
getTarget
- Specified by:
getTarget
in classAbstractCompilerMojo
-
getRelease
- Specified by:
getRelease
in classAbstractCompilerMojo
-
getCompilerArgument
- Specified by:
getCompilerArgument
in classAbstractCompilerMojo
-
getCompilerArguments
- Specified by:
getCompilerArguments
in classAbstractCompilerMojo
-
getGeneratedSourcesDirectory
- Specified by:
getGeneratedSourcesDirectory
in classAbstractCompilerMojo
-
getDebugFileName
- Specified by:
getDebugFileName
in classAbstractCompilerMojo
-
isTestCompile
protected boolean isTestCompile()- Overrides:
isTestCompile
in classAbstractCompilerMojo
-
getIncludes
- Specified by:
getIncludes
in classAbstractCompilerMojo
-
getExcludes
- Specified by:
getExcludes
in classAbstractCompilerMojo
-