Skip to content

Commit

Permalink
Get rid of 'forceAjcCompile' workaround and special includes.
Browse files Browse the repository at this point in the history
by separation of concerns: Let
  - Maven Compiler do annotation processing without compilation and
  - AspectJ Maven compilation of all Java sources and aspects without
    annotation processing.

Actually, we could let AJ Maven do all the work, but it would be
difficult to configure everything correctly in JDK 9+, because AJ Maven
is incomplete regarding automatically putting everything on the right
module paths. so, this separation of concerns saves tedious
configuration work.

Relates to mojohaus/aspectj-maven-plugin#15.

See #3282
  • Loading branch information
kriegaex authored and mp911de committed Dec 27, 2023
1 parent 7d7274a commit 24c8b77
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions spring-data-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@
</configuration>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<proc>only</proc>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
Expand All @@ -369,32 +376,37 @@
</dependencies>
<executions>
<execution>
<id>aspectj-compile</id>
<goals>
<goal>compile</goal>
</goals>
<phase>process-classes</phase>
<configuration>
</configuration>
</execution>
<execution>
<id>aspectj-test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
<phase>process-test-classes</phase>
<configuration>
</configuration>
</execution>
</executions>
<configuration>
<!-- Annotation processing is done by Maven Compiler (hard to configure for AJ Maven) -->
<proc>none</proc>
<!-- Generate metadata for reflection on method parameters -->
<parameters>true</parameters>
<verbose>true</verbose>
<!--
To workaround:
- https://issues.apache.org/jira/browse/MCOMPILER-205
- https://issues.apache.org/jira/browse/MCOMPILER-209
- https://github.com/mojohaus/aspectj-maven-plugin/issues/15
-->
<forceAjcCompile>true</forceAjcCompile>
<showWeaveInfo>true</showWeaveInfo>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<includes>
<include>**/domain/support/AuditingEntityListener.java</include>
</includes>
<complianceLevel>${source.level}</complianceLevel>
<source>${source.level}</source>
<target>${source.level}</target>
Expand Down

0 comments on commit 24c8b77

Please sign in to comment.