Skip to content

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

Closed
@pankajagrawal16

Description

@pankajagrawal16

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 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions