Skip to content

Commit

Permalink
Added UpgradeDependency recipes to the javax to jakarta migration. fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
traceyyoshima committed Jun 24, 2021
1 parent aaa4e4f commit 438aa60
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ recipeList:
- org.openrewrite.maven.RemoveDependency:
groupId: javax.xml.bind
artifactId: jaxb-api
# Remove the legacy sun JAXB runtime in facor of the glassfish artifact.
# Remove the legacy sun JAXB runtime in favor of the glassfish artifact.
- org.openrewrite.maven.RemoveDependency:
groupId: com.sun.xml.bind
artifactId: jaxb-impl
59 changes: 59 additions & 0 deletions src/main/resources/META-INF/rewrite/javax-to-jakarta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ recipeList:
- org.openrewrite.java.migrate.JavaxBatchMigrationToJakartaBatch
- org.openrewrite.java.migrate.JavaxInjectMigrationToJakartaInject

# TODO: separate each API migration into a declarative recipe and add the declarative recipe into the recipe list.
# JaxB API(x) .. update
- org.openrewrite.maven.AddDependency:
groupId: jakarta.xml.bind
Expand All @@ -39,6 +40,12 @@ recipeList:
onlyIfUsing:
- javax.xml.bind.*

# Upgrade the dependency to use the jakarta namespace if an older version already exists.
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: jakarta.xml.bind
artifactId: jakarta.xml.bind-api
newVersion: 3.x

# JaxB Runtime(x) .. update
- org.openrewrite.maven.AddDependency:
groupId: org.glassfish.jaxb
Expand All @@ -48,6 +55,12 @@ recipeList:
onlyIfUsing:
- javax.xml.bind.*

# Upgrade the dependency to use the jakarta namespace if an older version already exists.
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: org.glassfish.jaxb
artifactId: jaxb-runtime
newVersion: 3.x

# JaxWS API(x) .. update
- org.openrewrite.maven.AddDependency:
groupId: jakarta.xml.ws
Expand All @@ -56,6 +69,12 @@ recipeList:
onlyIfUsing:
- javax.xml.ws.*

# Upgrade the dependency to use the jakarta namespace if an older version already exists.
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: jakarta.xml.ws
artifactId: jakarta.xml.ws-api
newVersion: 3.x

# JaxWS Runtime(x) .. update
- org.openrewrite.maven.AddDependency:
groupId: com.sun.xml.ws
Expand All @@ -65,27 +84,51 @@ recipeList:
onlyIfUsing:
- javax.xml.ws.*

# Upgrade the dependency to use the jakarta namespace if an older version already exists.
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: com.sun.xml.ws
artifactId: jaxws-rt
newVersion: 3.x

- org.openrewrite.maven.AddDependency:
groupId: jakarta.transaction
artifactId: jakarta.transaction-api
version: 2.x
onlyIfUsing:
- javax.transaction.*

# Upgrade the dependency to use the jakarta namespace if an older version already exists.
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: jakarta.transaction
artifactId: jakarta.transaction-api
newVersion: 2.x

- org.openrewrite.maven.AddDependency:
groupId: jakarta.annotation
artifactId: jakarta.annotation-api
version: 2.x
onlyIfUsing:
- javax.annotation.*

# Upgrade the dependency to use the jakarta namespace if an older version already exists.
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: jakarta.annotation
artifactId: jakarta.annotation-api
newVersion: 2.x

- org.openrewrite.maven.AddDependency:
groupId: jakarta.activation
artifactId: jakarta.activation-api
version: 2.x
onlyIfUsing:
- javax.activation.*

# Upgrade the dependency to use the jakarta namespace if an older version already exists.
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: jakarta.activation
artifactId: jakarta.activation-api
newVersion: 2.x

# f(x).xml.bind
- org.openrewrite.java.ChangePackage:
oldPackageName: javax.xml.bind
Expand All @@ -106,6 +149,16 @@ recipeList:
oldPackageName: javax.activation
newPackageName: jakarta.activation

# Remove the legacy Javax JAXB API in favor of the the jakarta artifact.
- org.openrewrite.maven.RemoveDependency:
groupId: javax.xml.bind
artifactId: jaxb-api

# Remove the legacy sun JAXB runtime in favor of the glassfish artifact.
- org.openrewrite.maven.RemoveDependency:
groupId: com.sun.xml.bind
artifactId: jaxb-impl

# Remove Javax JaxWs API(x)
- org.openrewrite.maven.RemoveDependency:
groupId: javax.xml.ws
Expand All @@ -128,6 +181,12 @@ recipeList:
onlyIfUsing:
- javax.batch.*

# Upgrade the dependency to use the jakarta namespace if an older version already exists.
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: jakarta.batch
artifactId: jakarta.batch-api
newVersion: 2.x

# Note: ChangePackage does not update java doc references.
# f(x).batch
- org.openrewrite.java.ChangePackage:
Expand Down

0 comments on commit 438aa60

Please sign in to comment.