powertools-lambda-java icon indicating copy to clipboard operation
powertools-lambda-java copied to clipboard

Compilation warning when using powertools logging utility

Open Wynndow opened this issue 2 years ago • 0 comments

What were you trying to accomplish?

Compile a Java lambda using the Powertools logging utility without receiving compilation warnings.

Expected Behavior

No compilation warning when compiling.

Current Behavior

We introduced the powertools logging utility to our lambdas, compiled with Gradle. We're using the AspectJ Weaving Plugin to bring in the package. Now, when compiling the Java for each lambda in the project we receive a warning:

[warning] no match for this type name: SqsLargeMessageAspect [Xlint:invalidAbsoluteTypeName]

I’ve found the SqsLargeMessageAspect class defined in the powertools-sqs package - but we’re not using it. I’ve tried including it in the project to see if it helps with the warning, but it doesn’t.

The only other reference I can find to it is in software.amazon.lambda.powertools.logging.internal.LambdaLoggingAspect where it’s declared in a DeclarePrecedence annotation.

Steps to Reproduce (for bugs)

  1. Clone https://github.com/alphagov/di-ipv-core-back
  2. Run ./gradlew clean :lambdas:select-cri:compileJava
  3. Observe warning

Environment

  • Powertools version used: 1.12.2
  • Packaging format (Layers, Maven/Gradle): Gradle
  • AWS Lambda function runtime: java11
  • Debugging logs

How to enable debug mode**

> Task :lambdas:select-cri:compileJava
/di-ipv-core-back/lambdas/select-cri/build/classes/java/main/uk/gov/di/ipv/core/selectcri/SelectCriHandler.class [warning] no match for this type name: SqsLargeMessageAspect [Xlint:invalidAbsoluteTypeName]
(no source information available)
        [Xlint:invalidAbsoluteTypeName]

1 warning

Wynndow avatar Oct 05 '22 11:10 Wynndow