diff --git a/src/main/resources/META-INF/rewrite/java-version-11.yml b/src/main/resources/META-INF/rewrite/java-version-11.yml index fe747eb623..bd4044c3b4 100644 --- a/src/main/resources/META-INF/rewrite/java-version-11.yml +++ b/src/main/resources/META-INF/rewrite/java-version-11.yml @@ -183,13 +183,19 @@ recipeList: newGroupId: jakarta.xml.ws newArtifactId: jakarta.xml.ws-api newVersion: 2.3.x - # Add the jakarta JAXB artifact if it is missing but a project uses types in java.xml.bind + # Add the jakarta JAXB artifact if it is missing but a project uses types in either javax.jws or javax.xml.ws - org.openrewrite.java.dependencies.AddDependency: groupId: jakarta.xml.ws artifactId: jakarta.xml.ws-api version: 2.3.x onlyIfUsing: javax.jws..* acceptTransitive: true + - org.openrewrite.java.dependencies.AddDependency: + groupId: jakarta.xml.ws + artifactId: jakarta.xml.ws-api + version: 2.3.x + onlyIfUsing: javax.xml.ws..* + acceptTransitive: true # If a project already had the jakarta api, make sure it is at the latest version. - org.openrewrite.java.dependencies.UpgradeDependencyVersion: groupId: jakarta.xml.ws diff --git a/src/test/java/org/openrewrite/java/migrate/javax/AddJaxwsDependenciesTest.java b/src/test/java/org/openrewrite/java/migrate/javax/AddJaxwsDependenciesTest.java index b4b0e14387..db0c7da210 100644 --- a/src/test/java/org/openrewrite/java/migrate/javax/AddJaxwsDependenciesTest.java +++ b/src/test/java/org/openrewrite/java/migrate/javax/AddJaxwsDependenciesTest.java @@ -15,7 +15,6 @@ */ package org.openrewrite.java.migrate.javax; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openrewrite.config.Environment; import org.openrewrite.test.RecipeSpec; @@ -29,7 +28,6 @@ import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; import static org.openrewrite.maven.Assertions.pomXml; -@Disabled class AddJaxwsDependenciesTest implements RewriteTest { @Override @@ -173,13 +171,11 @@ void removeReferenceImplementationRuntime() { } dependencies { - compileOnly "com.sun.xml.ws:jaxws-rt:%s" + implementation "com.sun.xml.ws:jaxws-rt:%s" implementation "jakarta.xml.ws:jakarta.xml.ws-api:%s" - - testImplementation "com.sun.xml.ws:jaxws-rt:%s" } - """.formatted(rtVersion, wsApiVersion, rtVersion); + """.formatted(rtVersion, wsApiVersion); }) ), pomXml( @@ -276,13 +272,11 @@ void renameAndUpdateApiAndRuntime() { } dependencies { - compileOnly "com.sun.xml.ws:jaxws-rt:%s" + implementation "com.sun.xml.ws:jaxws-rt:%s" implementation "jakarta.xml.ws:jakarta.xml.ws-api:%s" - - testImplementation "com.sun.xml.ws:jaxws-rt:%s" } - """.formatted(rtVersion, wsApiVersion, rtVersion); + """.formatted(rtVersion, wsApiVersion); }) ), pomXml(