@Mojo(name="testCompile", defaultPhase=TEST_COMPILE, threadSafe=true, requiresDependencyResolution=TEST) public class TestCompilerMojo extends AbstractCompilerMojo
Modifier and Type | Field and Description |
---|---|
private java.util.Collection<java.lang.String> |
classpathElements |
private java.util.List<java.lang.String> |
compilePath |
private java.util.List<java.lang.String> |
compileSourceRoots
The source directories containing the test-source to be compiled.
|
private java.io.File |
generatedTestSourcesDirectory
Specify where to place generated source files created by annotation processing.
|
private org.codehaus.plexus.languages.java.jpms.LocationManager |
locationManager |
private java.util.Collection<java.lang.String> |
modulepathElements |
private java.io.File |
outputDirectory
The directory where compiled test classes go.
|
private java.util.Map<java.lang.String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> |
pathElements |
private boolean |
skip
Set this to 'true' to bypass compilation of test sources.
|
private java.lang.String |
testCompilerArgument
Sets the unformatted argument string to be passed to test compiler if fork is set to true.
|
private java.util.Map<java.lang.String,java.lang.String> |
testCompilerArguments
Sets the arguments to be passed to test compiler (prepending a dash) if fork is set to true.
|
private java.util.Set<java.lang.String> |
testExcludes
A list of exclusion filters for the compiler.
|
private java.util.Set<java.lang.String> |
testIncludes
A list of inclusion filters for the compiler.
|
private java.util.List<java.lang.String> |
testPath |
private java.lang.String |
testRelease
the -release argument for the test Java compiler
|
private java.lang.String |
testSource
The -source argument for the test Java compiler.
|
private java.lang.String |
testTarget
The -target argument for the test Java compiler.
|
compilerArgs, compilerArgument, compilerArguments, DEFAULT_SOURCE, DEFAULT_TARGET, MODULE_INFO_TARGET, PS, release, source, target
Constructor and Description |
---|
TestCompilerMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
protected java.util.List<java.lang.String> |
getClasspathElements() |
protected java.lang.String |
getCompilerArgument() |
protected java.util.Map<java.lang.String,java.lang.String> |
getCompilerArguments() |
protected java.util.List<java.lang.String> |
getCompileSourceRoots() |
protected java.io.File |
getGeneratedSourcesDirectory() |
protected java.util.List<java.lang.String> |
getModulepathElements() |
protected java.io.File |
getOutputDirectory() |
protected java.util.Map<java.lang.String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> |
getPathElements() |
protected java.lang.String |
getRelease() |
protected java.lang.String |
getSource() |
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner |
getSourceInclusionScanner(int staleMillis) |
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner |
getSourceInclusionScanner(java.lang.String inputFileEnding) |
protected java.lang.String |
getTarget() |
protected boolean |
isTestCompile() |
protected void |
preparePaths(java.util.Set<java.io.File> sourceFiles) |
convertToCompilerResult, getBuildStartTime, getProject, getRequestThreadCount, getToolchain, isDependencyChanged
@Parameter(property="maven.test.skip") private boolean skip
@Parameter(defaultValue="${project.testCompileSourceRoots}", readonly=true, required=true) private java.util.List<java.lang.String> compileSourceRoots
@Parameter(defaultValue="${project.build.testOutputDirectory}", required=true, readonly=true) private java.io.File outputDirectory
@Parameter private java.util.Set<java.lang.String> testIncludes
@Parameter private java.util.Set<java.lang.String> testExcludes
@Parameter(property="maven.compiler.testSource") private java.lang.String testSource
@Parameter(property="maven.compiler.testTarget") private java.lang.String testTarget
@Parameter(property="maven.compiler.testRelease") private java.lang.String testRelease
@Parameter private java.util.Map<java.lang.String,java.lang.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.
@Parameter private java.lang.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.
@Parameter(defaultValue="${project.build.directory}/generated-test-sources/test-annotations") private java.io.File generatedTestSourcesDirectory
Specify where to place generated source files created by annotation processing. Only applies to JDK 1.6+
@Parameter(defaultValue="${project.compileClasspathElements}", readonly=true) private java.util.List<java.lang.String> compilePath
@Parameter(defaultValue="${project.testClasspathElements}", readonly=true) private java.util.List<java.lang.String> testPath
private org.codehaus.plexus.languages.java.jpms.LocationManager locationManager
private java.util.Map<java.lang.String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> pathElements
private java.util.Collection<java.lang.String> classpathElements
private java.util.Collection<java.lang.String> modulepathElements
public void execute() throws org.apache.maven.plugin.MojoExecutionException, CompilationFailureException
execute
in interface org.apache.maven.plugin.Mojo
execute
in class AbstractCompilerMojo
org.apache.maven.plugin.MojoExecutionException
CompilationFailureException
protected java.util.List<java.lang.String> getCompileSourceRoots()
getCompileSourceRoots
in class AbstractCompilerMojo
protected java.util.Map<java.lang.String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> getPathElements()
getPathElements
in class AbstractCompilerMojo
protected java.util.List<java.lang.String> getClasspathElements()
getClasspathElements
in class AbstractCompilerMojo
protected java.util.List<java.lang.String> getModulepathElements()
getModulepathElements
in class AbstractCompilerMojo
protected java.io.File getOutputDirectory()
getOutputDirectory
in class AbstractCompilerMojo
protected void preparePaths(java.util.Set<java.io.File> sourceFiles)
preparePaths
in class AbstractCompilerMojo
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(int staleMillis)
getSourceInclusionScanner
in class AbstractCompilerMojo
protected org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(java.lang.String inputFileEnding)
getSourceInclusionScanner
in class AbstractCompilerMojo
protected java.lang.String getSource()
getSource
in class AbstractCompilerMojo
protected java.lang.String getTarget()
getTarget
in class AbstractCompilerMojo
protected java.lang.String getRelease()
getRelease
in class AbstractCompilerMojo
protected java.lang.String getCompilerArgument()
getCompilerArgument
in class AbstractCompilerMojo
protected java.util.Map<java.lang.String,java.lang.String> getCompilerArguments()
getCompilerArguments
in class AbstractCompilerMojo
protected java.io.File getGeneratedSourcesDirectory()
getGeneratedSourcesDirectory
in class AbstractCompilerMojo
protected boolean isTestCompile()
isTestCompile
in class AbstractCompilerMojo