Skip to content

Gradle setup works only with 5.x, 6.x but not with 7.x #146

Closed
@pankajagrawal16

Description

@pankajagrawal16

Gradle example provided works only when you are on gradle 5.x.

aspectj.AspectjGradlePlugin has to be pinned to version 0.0.3.

aspectj.AspectjGradlePlugin from version 0.0.4 is compiled on Java 12. Which makes plugin incompatible to use with lambda functions on runtime lower than Java 12.

Also version 0.0.3 had a bug which made it incompatible to work both on gradle versions 5.x and 6.x. Although this is now fixed in version 0.0.5, but the versions above 0.0.4 of plugin can only work with java 12 or above.

Here is the open issue to make plugin work with Java 11 or lower.

What were you trying to accomplish?

Expected Behavior

Should work with gradle 6.x as well.

Current Behavior

Fails with error on gradle 6.x


An exception occurred applying plugin request [id: 'aspectj.AspectjGradlePlugin', version: '0.0.3']
> Failed to apply plugin [id 'aspectj.AspectjGradlePlugin']
   > Could not create task ':compileAspect'.
      > Unnecessarily replacing a task that does not exist is not supported.  Use create() or register() directly instead.  You attempted to replace a task named 'compileAspect', but there is no existing task with that name.


Possible Solution

None as of now. Use gradle 5.x. with gradle 6.x users have to upgrade AWS lambda function runtime to Java 12 or above and use latest version of aspectj.AspectjGradlePlugin plugin.

Environment

  • Powertools version used: latest
  • Packaging format (Layers, Maven/Gradle): Gradle
  • AWS Lambda function runtime: Java 11 or lower
  • Debugging logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions