Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 4.0
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:All
-
Number of attachments :
Description
aspectj:test-compile compiles test classes to maven.build.dest by default (since that is the default value for maven.aspectj.dest). Of course, setting maven.aspectj.dest=${maven.test.dest} will cause test classes to be compiled to the right place. Unfortunately, this then causes the main classes to also be compiled there, instead of to maven.build.dest. The aspectj:test-classes goal should probably use a separate property, such as maven.aspectj.test.dest (defaulted to ${maven.test.dest}), for compiling test classes to.
This can cause problems since a project's resulting artifact (jar file) can be built incorrectly. If maven.aspectj.dest is set to maven.build.dest, then the jar file will contain test classes (if aspectj:test-compile is part of the build process). If maven.aspectj.dest is set to maven.test.dest, then the jar file will contain classes compiled by the standard compiler, not the aspectj compiler, since the aspectj compiler will put both main and test classes in maven.test.dest.