aws / aws-toolkit-jetbrains

AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
Apache License 2.0
730 stars 197 forks source link

Q transform does not add POM dependencies for @jakarta.annotation.Generated annotation #4625

Open yoan7712 opened 5 days ago

yoan7712 commented 5 days ago

Describe the bug Q transform does not add POM dependency for @jakarta.annotation.Generatedannotation when transforming my project from Java 8 to Java 17.

To reproduce Run Q transform on a project with @javax.annotation.Generated annotation, for example:

   @javax.annotation.Generated(
    value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen",
    date = "2023-10-30T11:44:39.078855-04:00[America/New_York]")

Q transform will replace the previous annotation with:

  @jakarta.annotation.Generated(
    value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen",
    date = "2023-10-30T11:44:39.078855-04:00[America/New_York]")

However Q transform will not add the required dependency and the transformation will fail. It will give "Unable to build code in Java 17 due to compilation error" error.

Expected behavior Q transform should add the following dependency to the project POM file:


           <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>3.0.0</version>
            </dependency>  

Your Environment