I've been away from AJ for a while, but needed to add it to my Java 17 project recently. This i my first time trying to use AJ with Java 11+.
I tried adding the aspectjrt and weaver dependencies to my POM and enabling CTW using the aspectj-maven-plugin as follows:
<dependencies>
....
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.19</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.19</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>dev.aspectj</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.13.1</version>
<configuration>
<complianceLevel>17</complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
<verbose>true</verbose>
<Xlint>ignore</Xlint>
<encoding>UTF-8 </encoding>
</configuration>
<executions>
<execution>
<goals>
<!-- use this goal to weave all your main classes -->
<goal>compile</goal>
<!-- use this goal to weave all your test classes -->
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
Yet when I try to compile anything, I get the following error which stumps me:
[INFO] --- aspectj:1.13.1:compile (default) @ poc-oauth-snowflake ---
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[WARNING] bad version number found in /Users/eric/dev/.m2/repository/org/aspectj/aspectjrt/1.9.19/aspectjrt-1.9.19.jar expected 1.9.8.RC1 found 1.9.19
<unknown source file>:<no line information>
[ERROR] Internal compiler error: java.lang.Exception: java.lang.IllegalStateException: Error processing configuration meta-data on public org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties() at org.aspectj.org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:172)
/Users/eric/dev/giis-finance/poc-oauth/src/main/java/poc/liquibase/oauth/service/AccessTokenService.java:0
(no source information available)
Removing AJC, and java compiles fine.
Does anyone know what configuration meta-data AJC might be complaining about, or what I might have missed in my config?
I'm running with :
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Homebrew (build 17.0.7+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.7+0, mixed mode, sharing)
Thanks!
Eric