aspectj:test-compile
Full name:
org.codehaus.mojo:aspectj-maven-plugin:1.15.0:test-compile
Description:
Attributes:
- Requires a Maven project to be executed.
- Requires dependency resolution of artifacts in scope:
test
. - The goal is thread-safe and supports parallel builds.
- Binds by default to the lifecycle phase:
test-compile
.
Optional Parameters
Name | Type | Since | Description |
---|---|---|---|
<additionalCompilerArgs> |
List<String> |
1.13 |
Sets additional compiler arguments, e.g.
Caveat: Be careful when using this option and select the additional compiler arguments wisely, because behaviour is undefined if you add arguments which have already been added by the plugin using regular parameters or their default values. The resulting compiler command line will in that case contain duplicate arguments, which might be illegal depending on the specific argument. Do not expect to be able to manually override existing arguments using this option or to replace whole argument lists. |
<ajdtBuildDefFile> |
String |
- |
Where to find the ajdt build definition file. If set this will override the use of project sourcedirs. |
<argumentFileName> |
String |
- |
The filename holding AJC build arguments. The file will be placed in the project build output directory, and will contain all the arguments passed to the AJC compiler in the last run, and also all the files included in the AJC build.
Sample content shown below to illustrate typical content within the builddef.lst file:
Default value is: builddef.lst . |
<aspectDirectory> |
String |
- |
The source directory for the aspects. Default value is: src/main/aspect . |
<aspectLibraries> |
Module[] |
- |
Weave binary aspects from the jars. The aspects should have been output by the same version of the compiler. The modules must also be dependencies of the project. Corresponds to ajc -aspectpath option |
<bootclasspath> |
String |
- |
Override location of VM's bootclasspath for purposes of evaluating types when compiling. Path is a single argument containing a list of paths to zip files or directories, delimited by the platform-specific path delimiter. |
<complianceLevel> |
String |
- |
Specify compiler compliance setting (same as setting 'source' and 'target' to the same level). Permitted values: 1.3, 1.4, 1.5, 5, 5.0, 1.6, 6, 6.0, 1.7, 7, 7.0, 1.8, 8, 8.0, 1.9, 9, 9.0, 10, 10.0, 11, 11.0, 12, 12.0, 13, 13.0, 14, 14.0, 15, 15.0, 16, 16.0, 17, 17.0 See also: AjcHelper.ACCEPTED_COMPLIANCE_LEVEL_VALUES Default value is: 1.4 . |
<crossrefs> |
boolean |
- |
generate .ajsym file into the output directory |
<deprecation> |
boolean |
- |
Toggle warning messages on deprecations |
<emacssym> |
boolean |
- |
Generate .ajesym symbol files for emacs support. |
<encoding> |
String |
- |
Specify default source encoding format. User property is: project.build.sourceEncoding . |
<excludes> |
String[] |
- |
List of ant-style patterns used to specify the aspects that should be excluded when compiling. When none specified all .java and .aj files in the project source directories, or directories specified by the ajdtDefFile property are included. |
<forceAjcCompile> |
boolean |
- |
Forces re-compilation, regardless of whether the compiler arguments or the sources have changed. Default value is: false . |
<generatedTestSourcesDirectory> |
File |
- |
The directory for sources generated by annotation processing. Default value is: ${project.build.directory}/generated-test-sources/aspectj-maven-plugin . |
<includes> |
String[] |
- |
List of ant-style patterns used to specify the aspects that should be included when compiling. When none specified all .java and .aj files in the project source directories, or directories specified by the ajdtDefFile property are included. |
<noImportError> |
boolean |
- |
Emit no errors for unresolved imports; |
<outxml> |
boolean |
- |
Generate aop.xml file for load-time weaving with default name (/META-INF/aop.xml). |
<outxmlfile> |
String |
- |
Generate aop.xml file for load-time weaving with custom name. |
<parameters> |
boolean |
- |
Set the compiler "parameters" argument. |
<preserveAllLocals> |
boolean |
- |
Preserve all local variables during code generation (to facilitate debugging). |
<proc> |
String |
- |
Set the compiler "proc" argument. Aspectj supports Annotation processing since 1.8.2, it can been disabled by proc:none .See also: AspectJ 1.8.2 Release notes, Annotation Processing |
<proceedOnError> |
boolean |
- |
Keep compiling after error, dumping class files with problem methods |
<referenceInfo> |
boolean |
- |
Compute reference information. |
<repeat> |
int |
- |
Repeat compilation process N times (typically to do performance analysis). |
<showWeaveInfo> |
boolean |
- |
Emit messages about weaving |
<skip> |
boolean |
- |
Skip plugin execution. Default value is: false .User property is: aspectj.skip . |
<source> |
String |
- |
Specify source code language level (1.3 to 1.9, 10 to 17). See 'complianceLevel' for details. See also: AjcHelper.ACCEPTED_COMPLIANCE_LEVEL_VALUES Default value is: ${mojo.java.target} . |
<target> |
String |
- |
Specify bytecode target setting (1.3 to 1.9, 10 to 17). See 'complianceLevel' for details. See also: AjcHelper.ACCEPTED_COMPLIANCE_LEVEL_VALUES Default value is: ${project.build.java.target} . |
<testAspectDirectory> |
String |
- |
The source directory for the test aspects. Default value is: src/test/aspect . |
<testSources> |
Scanner[] |
1.4 |
Set the java test source folders to use, specifying the includes and excludes. If you don't specify this parameter, all java test sources of the current project fill be used. If you specify this parameter as an empty tag (i.e. <testSources/>), all test source folders will be ignored. Otherwise specify the test source folder(s) to use. See also: org.codehaus.plexus.util.DirectoryScanner |
<verbose> |
boolean |
- |
Emit messages about accessed/processed compilation units |
<warn> |
String |
- |
Emit warnings for any instances of the comma-delimited list of questionable code. Supported values are shown in the list below, with their respective explanations - as copied directly from the AJC reference.
See also: Eclipse AJC reference |
<weaveDependencies> |
Module[] |
- |
List of of modules to weave (into target directory). Corresponds to ajc -inpath option (or -injars for pre-1.2 (which is not supported)). |
<weaveDirectories> |
String[] |
1.4 |
List of of directories with .class files to weave (into target directory). Corresponds to ajc -inpath option. |
<weaveMainSourceFolder> |
boolean |
- |
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. Default value is: false . |
<weaveWithAspectsInMainSourceFolder> |
boolean |
- |
Flag to indicate if aspects in the the main source dirs should be a part of the compile process Default value is: true . |
<XaddSerialVersionUID> |
boolean |
- |
Causes the compiler to calculate and add the SerialVersionUID field to any type implementing java.io.Serializable that is affected by an aspect. The field is calculated based on the class before weaving has taken place. |
<Xajruntimetarget> |
String |
- |
(Experimental) Allows code to be generated that targets a 1.2 or a 1.5 level AspectJ runtime (default 1.5) Default value is: 1.5 . |
<XhasMember> |
boolean |
1.3 |
Enables the compiler to support hasmethod(method_pattern) and hasfield(field_pattern) type patterns, but only within declare statements. It's experimental and undocumented because it may change, and because it doesn't yet take into account ITDs. |
<Xjoinpoints> |
String |
- |
supply a comma separated list of new joinpoints that can be identified by pointcuts. Values are: arrayconstruction, synchronization |
<Xlint> |
String |
- |
Set default level for messages about potential programming mistakes in crosscutting code. {level} may be ignore, warning, or error. This overrides entries in org/aspectj/weaver/XlintDefault.properties from aspectjtools.jar. |
<Xlintfile> |
File |
- |
Specify properties file to set levels for specific crosscutting messages. PropertyFile is a path to a Java .properties file that takes the same property names and values as org/aspectj/weaver/XlintDefault.properties from aspectjtools.jar, which it also overrides. |
<xmlConfigured> |
File |
- |
Parameter which indicates an XML file containing AspectJ weaving instructions. Assigning this plugin parameter adds the -xmlConfigured option to ajc.See also: http://www.eclipse.org/aspectj/doc/next/devguide/ajc-ref.html |
<XnoInline> |
boolean |
- |
(Experimental) do not inline around advice |
<XnotReweavable> |
boolean |
- |
(Experimental) Create class files that can't be subsequently rewoven by AspectJ. |
<Xreweavable> |
boolean |
- |
(Experimental) runs weaver in reweavable mode which causes it to create woven classes that can be rewoven, subject to the restriction that on attempting a reweave all the types that advised the woven type must be accessible. |
<XserializableAspects> |
boolean |
- |
(Experimental) Normally it is an error to declare aspects java.io.Serializable . This option removes that restriction. |
<Xset> |
Map<String,String> |
1.5 |
Allows the caller to provide additional arguments in a Map format. For example:
<configuration> <Xset> <overWeaving>true</overWeaving> <avoidFinal>false</avoidFinal> </Xset> </configuration> |
<XterminateAfterCompilation> |
boolean |
- |
Causes compiler to terminate before weaving |
Parameter Details
<additionalCompilerArgs>
<compilerArgs>
<arg>-Xmaxerrs=1000</arg>
<arg>-Xlint</arg>
<arg>-J-Duser.language=en_us</arg>
</compilerArgs>
Caveat: Be careful when using this option and select the additional compiler arguments wisely, because behaviour is undefined if you add arguments which have already been added by the plugin using regular parameters or their default values. The resulting compiler command line will in that case contain duplicate arguments, which might be illegal depending on the specific argument. Do not expect to be able to manually override existing arguments using this option or to replace whole argument lists.
- Type:
java.util.List<java.lang.String>
- Since:
1.13
- Required:
No
<ajdtBuildDefFile>
- Type:
java.lang.String
- Required:
No
<argumentFileName>
Sample content shown below to illustrate typical content within the builddef.lst file:
-1.6
-encoding
UTF-8
-classpath
/my/library/lib.jar:/somewhere/aspectjrt.jar:/my/project/target/classes
-d
/my/project/target/classes
/my/project/src/main/java/org/acme/ValidationAspect.java
- Type:
java.lang.String
- Required:
No
- Default:
builddef.lst
<aspectDirectory>
- Type:
java.lang.String
- Required:
No
- Default:
src/main/aspect
<aspectLibraries>
ajc -aspectpath
option- Type:
org.codehaus.mojo.aspectj.Module[]
- Required:
No
<bootclasspath>
- Type:
java.lang.String
- Required:
No
<complianceLevel>
See also: AjcHelper.ACCEPTED_COMPLIANCE_LEVEL_VALUES
- Type:
java.lang.String
- Required:
No
- Default:
1.4
<crossrefs>
- Type:
boolean
- Required:
No
<deprecation>
- Type:
boolean
- Required:
No
<emacssym>
- Type:
boolean
- Required:
No
<encoding>
- Type:
java.lang.String
- Required:
No
- User Property:
project.build.sourceEncoding
<excludes>
- Type:
java.lang.String[]
- Required:
No
<forceAjcCompile>
- Type:
boolean
- Required:
No
- Default:
false
<generatedTestSourcesDirectory>
- Type:
java.io.File
- Required:
No
- Default:
${project.build.directory}/generated-test-sources/aspectj-maven-plugin
<includes>
- Type:
java.lang.String[]
- Required:
No
<noImportError>
- Type:
boolean
- Required:
No
<outxml>
- Type:
boolean
- Required:
No
<outxmlfile>
- Type:
java.lang.String
- Required:
No
<parameters>
- Type:
boolean
- Required:
No
<preserveAllLocals>
- Type:
boolean
- Required:
No
<proc>
proc:none
.See also: AspectJ 1.8.2 Release notes, Annotation Processing
- Type:
java.lang.String
- Required:
No
<proceedOnError>
- Type:
boolean
- Required:
No
<referenceInfo>
- Type:
boolean
- Required:
No
<repeat>
- Type:
int
- Required:
No
<showWeaveInfo>
- Type:
boolean
- Required:
No
<skip>
- Type:
boolean
- Required:
No
- User Property:
aspectj.skip
- Default:
false
<source>
See also: AjcHelper.ACCEPTED_COMPLIANCE_LEVEL_VALUES
- Type:
java.lang.String
- Required:
No
- Default:
${mojo.java.target}
<target>
See also: AjcHelper.ACCEPTED_COMPLIANCE_LEVEL_VALUES
- Type:
java.lang.String
- Required:
No
- Default:
${project.build.java.target}
<testAspectDirectory>
- Type:
java.lang.String
- Required:
No
- Default:
src/test/aspect
<testSources>
Set the java test source folders to use, specifying the includes and excludes.
If you don't specify this parameter, all java test sources of the current project fill be used. If you specify this parameter as an empty tag (i.e. <testSources/>), all test source folders will be ignored. Otherwise specify the test source folder(s) to use.
See also: org.codehaus.plexus.util.DirectoryScanner
- Type:
org.codehaus.plexus.util.Scanner[]
- Since:
1.4
- Required:
No
<verbose>
- Type:
boolean
- Required:
No
<warn>
- constructorName
- method with constructor name
- packageDefaultMethod
- attempt to override package-default method
- deprecation
- usage of deprecated type or member
- maskedCatchBlocks
- hidden catch block
- unusedLocals
- local variable never read
- unusedArguments
- method argument never read
- unusedImports
- import statement not used by code in file
- none
- suppress all compiler warnings
See also: Eclipse AJC reference
- Type:
java.lang.String
- Required:
No
<weaveDependencies>
ajc -inpath
option (or -injars
for pre-1.2 (which is not supported)).- Type:
org.codehaus.mojo.aspectj.Module[]
- Required:
No
<weaveDirectories>
ajc -inpath
option.- Type:
java.lang.String[]
- Since:
1.4
- Required:
No
<weaveMainSourceFolder>
- Type:
boolean
- Required:
No
- Default:
false
<weaveWithAspectsInMainSourceFolder>
- Type:
boolean
- Required:
No
- Default:
true
<XaddSerialVersionUID>
java.io.Serializable
that is affected by an aspect. The field is calculated based on the class before weaving has taken place.- Type:
boolean
- Required:
No
<Xajruntimetarget>
- Type:
java.lang.String
- Required:
No
- Default:
1.5
<XhasMember>
- Type:
boolean
- Since:
1.3
- Required:
No
<Xjoinpoints>
- Type:
java.lang.String
- Required:
No
<Xlint>
- Type:
java.lang.String
- Required:
No
<Xlintfile>
- Type:
java.io.File
- Required:
No
<xmlConfigured>
-xmlConfigured
option to ajc.See also: http://www.eclipse.org/aspectj/doc/next/devguide/ajc-ref.html
- Type:
java.io.File
- Required:
No
<XnoInline>
- Type:
boolean
- Required:
No
<XnotReweavable>
- Type:
boolean
- Required:
No
<Xreweavable>
- Type:
boolean
- Required:
No
<XserializableAspects>
java.io.Serializable
. This option removes that restriction.- Type:
boolean
- Required:
No
<Xset>
<configuration> <Xset> <overWeaving>true</overWeaving> <avoidFinal>false</avoidFinal> </Xset> </configuration>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Since:
1.5
- Required:
No
<XterminateAfterCompilation>
- Type:
boolean
- Required:
No