Skip to content

Duplicate jaxws-rt dependency when running Java8toJava11 then JakartaEE9 #730

@evie-lau

Description

@evie-lau

As for your other question: not sure; I'd expect folks to run Java8toJava11, and through that AddCommonAnnotationsDependencies before they run JavaxMigrationToJakarta, but it's hard to say at times.

Originally posted by @timtebeek in #729 (comment)

When running Java8toJava11 followed by JavaxMigrationToJakarta, the pom.xml ends up with 2 copies of com.sun.xml.ws:jaxws-rt.

It seems from the 8to11 migration, AddJaxwsRuntime adds jaxws-rt:2.3.x, then in the EE9 migration, JavaxXmlWsMigrationToJakartaXmlWs adds jaxws-rt:3.0.x

The pom then ends up having:

  <dependency>
   <groupId>com.sun.xml.ws</groupId>
   <artifactId>jaxws-rt</artifactId>
   <version>3.0.2</version>
   <scope>runtime</scope>
  </dependency>
  <dependency>
   <groupId>com.sun.xml.ws</groupId>
   <artifactId>jaxws-rt</artifactId>
   <version>2.3.7</version>
   <scope>provided</scope>
  </dependency>

I'm thinking the EE9 recipe should do some more cleanup of the previous versions (also seems something in here is also not quite playing well with the jaxws-rt:2.3.7 when trying to Add/Upgrade to 3.x, maybe similar to issue #728)

- org.openrewrite.java.dependencies.AddDependency:
groupId: com.sun.xml.ws
artifactId: jaxws-rt
version: 3.x
scope: runtime
onlyIfUsing: javax.xml.ws..*
acceptTransitive: true
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: com.sun.xml.ws
artifactId: jaxws-rt
newVersion: 3.x

Using rewrite-migrate-java: 3.10.0-SNAPSHOT

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions