Package org.codehaus.mojo.aspectj
Class AjcTestCompileMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.aspectj.AbstractAjcMojo
-
- org.codehaus.mojo.aspectj.AbstractAjcCompiler
-
- org.codehaus.mojo.aspectj.AjcTestCompileMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="test-compile", threadSafe=true, defaultPhase=TEST_COMPILE, requiresDependencyResolution=TEST) public class AjcTestCompileMojo extends AbstractAjcCompiler
Weaves all test classes. AspectJ Compiler Plugin.- Author:
- Kaare Nilsen
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
MAVEN_TEST_SKIP
protected boolean
weaveMainSourceFolder
Flag to indicate if the main source dirs should be a part of the compile process.protected boolean
weaveWithAspectsInMainSourceFolder
Flag to indicate if aspects in the the main source dirs should be a part of the compile process-
Fields inherited from class org.codehaus.mojo.aspectj.AbstractAjcCompiler
additionalCompilerArgs, ajcOptions, ajdtBuildDefFile, argumentFileName, aspectDirectory, bootclasspath, complianceLevel, crossrefs, deprecation, emacssym, encoding, excludes, forceAjcCompile, includes, noImportError, outxml, outxmlfile, parameters, preserveAllLocals, proc, proceedOnError, referenceInfo, repeat, resolvedIncludes, showWeaveInfo, source, target, testAspectDirectory, verbose, warn, XaddSerialVersionUID, Xajruntimetarget, XAJRUNTIMETARGET_SUPPORTED_VALUES, XhasMember, Xjoinpoints, Xlint, Xlintfile, XnoInline, XnotReweavable, Xreweavable, XserializableAspects, Xset, XterminateAfterCompilation
-
Fields inherited from class org.codehaus.mojo.aspectj.AbstractAjcMojo
aspectLibraries, basedir, project, weaveDependencies, weaveDirectories, xmlConfigured
-
-
Constructor Summary
Constructors Constructor Description AjcTestCompileMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
Do the AspectJ compiling.protected java.lang.String
getAdditionalAspectPaths()
Abstract method used by child classes to specify additional aspect paths.protected java.util.List<java.lang.String>
getClasspathDirectories()
Abstract method used by child classes to specify the correct output directory for compiled classes.java.io.File
getGeneratedSourcesDirectory()
The directory for sources generated by annotation processing.protected org.codehaus.plexus.util.Scanner[]
getJavaSources()
protected java.io.File
getOutputDirectory()
The directory where compiled classes go.protected java.util.List<java.lang.String>
getSourceDirectories()
Abstract method used by child classes to specify the correct source directory for classes.-
Methods inherited from class org.codehaus.mojo.aspectj.AbstractAjcCompiler
assembleArguments, getIncludedSources, isBuildNeeded, setArgumentFileName, setBootClassPath, setComplianceLevel, setCrossrefs, setDeprecation, setEmacssym, setEncoding, setNoImportError, setOutxml, setOutxmlfile, setParameters, setPreserveAllLocals, setProceedOnError, setReferenceInfo, setRepeat, setShowWeaveInfo, setSource, setTarget, setVerbose, setWarn, setXaddSerialVersionUID, setXajruntimetarget, setXhasMember, setXjoinpoints, setXlint, setXlintfile, setXnoInline, setXnotReweavable, setXreweavable, setXserializableAspects, setXset, setXterminateAfterCompilation
-
Methods inherited from class org.codehaus.mojo.aspectj.AbstractAjcMojo
isSkip, setXmlConfigured
-
-
-
-
Field Detail
-
MAVEN_TEST_SKIP
protected static final java.lang.String MAVEN_TEST_SKIP
- See Also:
- Constant Field Values
-
weaveMainSourceFolder
@Parameter(defaultValue="false") protected boolean weaveMainSourceFolder
Flag to indicate if the main source dirs should be a part of the compile process. Note! This will make all classes in main source dir appear in the test output dir also, potentially overwriting test resources.
-
weaveWithAspectsInMainSourceFolder
@Parameter(defaultValue="true") protected boolean weaveWithAspectsInMainSourceFolder
Flag to indicate if aspects in the the main source dirs should be a part of the compile process
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
Description copied from class:AbstractAjcCompiler
Do the AspectJ compiling.- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Overrides:
execute
in classAbstractAjcCompiler
- Throws:
org.apache.maven.plugin.MojoExecutionException
- if arguments file cannot be written
-
getClasspathDirectories
protected java.util.List<java.lang.String> getClasspathDirectories()
Description copied from class:AbstractAjcCompiler
Abstract method used by child classes to specify the correct output directory for compiled classes.- Specified by:
getClasspathDirectories
in classAbstractAjcCompiler
- Returns:
- the directories containing compiled classes.
-
getOutputDirectory
protected java.io.File getOutputDirectory()
Description copied from class:AbstractAjcCompiler
The directory where compiled classes go.- Specified by:
getOutputDirectory
in classAbstractAjcCompiler
- Returns:
- the outputDirectory
-
getGeneratedSourcesDirectory
public java.io.File getGeneratedSourcesDirectory()
Description copied from class:AbstractAjcCompiler
The directory for sources generated by annotation processing.- Specified by:
getGeneratedSourcesDirectory
in classAbstractAjcCompiler
- Returns:
- the generatedSourcesDirectory
-
getSourceDirectories
protected java.util.List<java.lang.String> getSourceDirectories()
Description copied from class:AbstractAjcCompiler
Abstract method used by child classes to specify the correct source directory for classes.- Specified by:
getSourceDirectories
in classAbstractAjcCompiler
- Returns:
- where sources may be found.
-
getJavaSources
protected org.codehaus.plexus.util.Scanner[] getJavaSources()
- Specified by:
getJavaSources
in classAbstractAjcCompiler
-
getAdditionalAspectPaths
protected java.lang.String getAdditionalAspectPaths()
Description copied from class:AbstractAjcCompiler
Abstract method used by child classes to specify additional aspect paths.- Specified by:
getAdditionalAspectPaths
in classAbstractAjcCompiler
- Returns:
- the additional aspect paths
-
-