Skip to content

Build failure when including aspectj-maven-plugin with runtime version java 11,12,13 #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pankajagrawal16 opened this issue Aug 26, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@pankajagrawal16
Copy link
Contributor

pankajagrawal16 commented Aug 26, 2020

Following the setup instructions of the library and including below snippet under <build>section, Lambda is working with runtime Java 11. Tried with Java 10, 12 and 13 as well.

        <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>aspectj-maven-plugin</artifactId>
             <version>1.11</version>
             <configuration>
                 <source>1.8</source>
                 <target>1.8</target>

Build fails with below logs:

Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile failed: 
Plugin org.codehaus.mojo:aspectj-maven-plugin:1.11 or one of its dependencies could not be resolved: 
Could not find artifact com.sun:tools:jar:13.0.2 at specified path /Library/../lib/tools.jar 

Expected Behavior

Build should succeed and able to use the library utilities

Current Behavior

Build fails with below logs:

Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile failed: 
Plugin org.codehaus.mojo:aspectj-maven-plugin:1.11 or one of its dependencies could not be resolved: 
Could not find artifact com.sun:tools:jar:13.0.2 at specified path /Library/../lib/tools.jar 

Possible Solution

There is a bug report on official version of aspectj-maven-plugin which makes plugin incompatible with these java version.

Suggested workaround for now is to use below plugin as discussed in this issue until plugin is patched.

           <plugin>
                <groupId>com.nickwongdev</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.12.1</version>

Steps to Reproduce (for bugs)

  1. Follow setup instruction
  2. Make Lambda runtime as one of Java 10,11,12,13
  3. Build the project
  4. Build fails with below logs

Environment

  • Powertools version used: Latest
  • Packaging format (Layers, Maven/Gradle): Maven/Gradle
  • AWS Lambda function runtime: Java 10, 11, 12, 13.
  • Debugging logs
Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile failed: 
Plugin org.codehaus.mojo:aspectj-maven-plugin:1.11 or one of its dependencies could not be resolved: 
Could not find artifact com.sun:tools:jar:13.0.2 at specified path /Library/Java//../lib/tools.jar 
@pankajagrawal16
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants