Skip to content

Commit

Permalink
Move AspectJ Maven executions to default phases
Browse files Browse the repository at this point in the history
Document the pros and cons in the POM with this comment:

Attention: aspectj-maven-plugin MUST be declared AFTER
maven-compiler-plugin, if they are both supposed to run in the same
default phases 'compile' and 'test-compile', but execution order is to
be guaranteed. Then, you have the convenience of being able to run e.g.
'mvn [clean] compile' instead of 'mvn [clean] process-classes'. For a
slightly less convenient, but less refactoring-error-prone solution,
see the commented-out phases below.
  • Loading branch information
kriegaex committed Dec 29, 2023
1 parent 9c57863 commit 6e28a9f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spring-data-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@
</configuration>
</plugin>

<!--
Attention: aspectj-maven-plugin MUST be declared AFTER maven-compiler-plugin, if they are both supposed to run
in the same default phases 'compile' and 'test-compile', but execution order is to be guaranteed. Then, you have
the convenience of being able to run e.g. 'mvn [clean] compile' instead of 'mvn [clean] process-classes'. For a
slightly less convenient, but less refactoring-error-prone solution, see the commented-out phases below.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
Expand All @@ -374,14 +380,14 @@
<goals>
<goal>compile</goal>
</goals>
<phase>process-classes</phase>
<!--<phase>process-classes</phase>-->
</execution>
<execution>
<id>aspectj-test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
<phase>process-test-classes</phase>
<!--<phase>process-test-classes</phase>-->
</execution>
</executions>
<configuration>
Expand Down

0 comments on commit 6e28a9f

Please sign in to comment.