I build our multi-project application with Maven(lots of pom.xml-s). We recently introduced AspectJ, however I suspect AspectJ contributes to performance problems. In order to be sure, I'd like to build the application this time without AspectJ and see how it performs. But I would not really like to remove all AspectJ related stuff from pom.xml, so it would be handy if there was some kind of flag or something that could exclude AspectJ from build. Is there any?
Update: this does not seem to have any effect: -Dmaven.aspectj.skip=true
Asked
Active
Viewed 1,490 times
2
-
Do you want to exclude a aspectJ plugin or the corresponding libraries? – chris.tian Feb 06 '14 at 09:24
-
What I want is to revert back to the time when aspectj was not included without the removal of the aspectj from pom.xml. – Sanyifejű Feb 06 '14 at 09:33
-
Have you tried the disabling of the AspectJ plugin as proposed below? Thereby the AspectJ compilter will no be activated during build. – chris.tian Feb 06 '14 at 09:55
-
sorry, other things had higher priority, but I'll give a try to your approach and if it works I'll mark it as accepted answer – Sanyifejű Feb 06 '14 at 15:56
1 Answers
4
If you want to disable the aspectj-maven-plugin temporarily, you could add a profile to the parent pom.xml which deregisters the executions of the plugin (by assigning them to phase none). Could look like this (add your own execution IDs if you have some):
<profile>
<id>noAspectJ</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<phase>none</phase>
</execution>
<execution>
<id>test-compile</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
A simple maven cmd activates this:
mvn clean install -PnoAspectJ

chris.tian
- 770
- 5
- 13