rewrite-migrate-java icon indicating copy to clipboard operation
rewrite-migrate-java copied to clipboard

jakarta.xml.ws-api is adding wrong dependency version

Open thigg opened this issue 2 years ago • 1 comments

I ran the migrate jdk11 receipe on a project that already uses jakarta.xml.ws-api:2.3.3.

The receipe upgraded the version to 2.3.6. This version exists for the runtime only.

There is no version 2.3.6 of the api.

This would be correct: (and how it was before running the receipe)

  <dependency>
                <groupId>jakarta.xml.ws</groupId>
                <artifactId>jakarta.xml.ws-api</artifactId>
                <version>2.3.3</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>jaxws-rt</artifactId>
                <version>2.3.6</version>
                <scope>runtime</scope>
            </dependency>

This was the change the receipe introduced:

            <dependency>
                <groupId>jakarta.xml.ws</groupId>
                <artifactId>jakarta.xml.ws-api</artifactId>
                <version>2.3.6</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>jaxws-rt</artifactId>
                <version>2.3.6</version>
                <scope>runtime</scope>
            </dependency>

Ran the receipe with:

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \             
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:LATEST \
-DactiveRecipes=org.openrewrite.java.migrate.Java8toJava11

thigg avatar Feb 28 '23 08:02 thigg

Thanks for reporting this issue here @thigg ! Would you happen to have a snippet of the log output that highlights which recipes made changes to your pom.xml file? Those lines typically start with [WARNING] Changes have been made to pom.xml by:

At first glance I would only expect changes to be made by JavaxXmlWsMigrationToJakartaXmlWs, which ought to pick up the latest.release version as seen on Maven Central.

timtebeek avatar Mar 01 '23 09:03 timtebeek

There have been a lot of changes since this issue was opened; especially today with these going through

  • https://github.com/openrewrite/rewrite/pull/4273
  • https://github.com/openrewrite/rewrite-migrate-java/pull/499

I'd lean towards closing this one and reopening a new one if necessary.

timtebeek avatar Jun 20 '24 19:06 timtebeek