dev-aspectj / aspectj-maven-plugin

AspectJ Maven Plugin
MIT License
48 stars 10 forks source link

Not working with JDK 20 #124

Closed muhamadto closed 1 year ago

muhamadto commented 1 year ago

I tried it with JDK 20 but it complains with the following errors

[ERROR] Failed to execute goal dev.aspectj:aspectj-maven-plugin:1.13.1:compile (default) on project spring-native-aws-lambda-function: AJC compiler errors:
[ERROR] error unrecognized single argument: "-20"
[ERROR] error no sources specified

I have the following plugin configuration

  <build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
      <plugin>
        <groupId>dev.aspectj</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <version>1.13.1</version>
        <configuration>
          <source>20</source>
          <target>20</target>
          <complianceLevel>20</complianceLevel>
          <aspectLibraries>
            <aspectLibrary>
              <groupId>software.amazon.lambda</groupId>
              <artifactId>powertools-logging</artifactId>
              <version>1.9.20</version>
            </aspectLibrary>
          </aspectLibraries>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

Complere pom.xml here

muhamadto commented 1 year ago

added

          <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>${aspectj.version}</version>
          </dependency>

in the plugin and it works

kriegaex commented 1 year ago

Next time, please read some basic documentation.

https://github.com/dev-aspectj/aspectj-maven-plugin#how-to-use-the-aspectj-and-java-versions-of-your-own-choice