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 Stringwhen forking and debug activated the commandline used will be dumped in this fileprivate FileSpecify where to place generated source files created by annotation processing.(package private) final org.codehaus.plexus.languages.java.jpms.LocationManagerprivate Collection<String> private FileThe directory where compiled test classes go.private booleanSet this to 'true' to bypass compilation of test sources.private StringSets 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 Stringthe -release argument for the test Java compilerprivate StringThe -source argument for the test Java compiler.private StringThe -target argument for the test Java compiler.private booleanWhentrue, 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, targetFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()protected Stringprotected Stringprotected Fileprotected Fileprotected Stringprotected Stringprotected org.codehaus.plexus.compiler.util.scan.SourceInclusionScannergetSourceInclusionScanner(int staleMillis) protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScannergetSourceInclusionScanner(String inputFileEnding) protected Stringprotected booleanprotected voidpreparePaths(Set<File> sourceFiles) Methods inherited from class org.apache.maven.plugin.compiler.AbstractCompilerMojo
getBuildStartTime, getImplicit, getModuleDeclaration, getProject, getRequestThreadCount, getToolchain, isDependencyChanged, setRelease, setTargetMethods 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.outputDirectoryfor 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:
executein interfaceorg.apache.maven.plugin.Mojo- Overrides:
executein classAbstractCompilerMojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionCompilationFailureException
-
getCompileSourceRoots
- Specified by:
getCompileSourceRootsin classAbstractCompilerMojo
-
getPathElements
protected Map<String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> getPathElements()- Specified by:
getPathElementsin classAbstractCompilerMojo
-
getClasspathElements
- Specified by:
getClasspathElementsin classAbstractCompilerMojo
-
getModulepathElements
- Specified by:
getModulepathElementsin classAbstractCompilerMojo
-
getOutputDirectory
- Specified by:
getOutputDirectoryin classAbstractCompilerMojo
-
preparePaths
- Specified by:
preparePathsin classAbstractCompilerMojo
-
getSourceInclusionScanner
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(int staleMillis) - Specified by:
getSourceInclusionScannerin classAbstractCompilerMojo
-
getSourceInclusionScanner
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(String inputFileEnding) - Specified by:
getSourceInclusionScannerin classAbstractCompilerMojo
-
getSource
- Specified by:
getSourcein classAbstractCompilerMojo
-
getTarget
- Specified by:
getTargetin classAbstractCompilerMojo
-
getRelease
- Specified by:
getReleasein classAbstractCompilerMojo
-
getCompilerArgument
- Specified by:
getCompilerArgumentin classAbstractCompilerMojo
-
getCompilerArguments
- Specified by:
getCompilerArgumentsin classAbstractCompilerMojo
-
getGeneratedSourcesDirectory
- Specified by:
getGeneratedSourcesDirectoryin classAbstractCompilerMojo
-
getDebugFileName
- Specified by:
getDebugFileNamein classAbstractCompilerMojo
-
isTestCompile
protected boolean isTestCompile()- Overrides:
isTestCompilein classAbstractCompilerMojo
-
getIncludes
- Specified by:
getIncludesin classAbstractCompilerMojo
-
getExcludes
- Specified by:
getExcludesin classAbstractCompilerMojo
-