What version of OpenRewrite are you using?
I am using:
- Maven/Gradle plugin 5.34.0
- rewrite-spring 5.13.2
How are you running OpenRewrite?
I'm using maven plugin on my own project.
You can check the project here:
https://github.com/mgvinuesa/spring-petclinic-openrewrite
It is a fork of spring-petclinic and you might use the branch with the name migrate_with_open_rewrite, I started with the TAG 1.5.x to migrate boot Spring Boot and Java using OpenRewrite.
What is the smallest, simplest way to reproduce the problem?
Execute the mvn command with the current configuration with Java 8.
mvn rewrite:run
What did you expect to see?
The wro4j-maven-plugin might upgrade from 1.8.0 to 2.X due to Java17 compatibility.
The recipe that adds jakarta.xml.bind-api must include the latest version instead of 2.3.3.
What did you see instead?
Even there is a recipe to work with wro4j:
org.openrewrite.java.migrate.UpgradeToJava17
[WARNING] org.openrewrite.java.migrate.Java8toJava11
[WARNING] org.openrewrite.java.migrate.javax.AddJaxbDependencies
[WARNING] org.openrewrite.java.dependencies.AddDependency: {groupId=jakarta.xml.bind, artifactId=jakarta.xml.bind-api, version=2.3.x, onlyIfUsing=javax.xml.bind..*, acceptTransitive=true}
[WARNING] org.openrewrite.java.migrate.cobertura.RemoveCoberturaMavenPlugin
[WARNING] org.openrewrite.maven.RemovePlugin: {groupId=org.codehaus.mojo, artifactId=cobertura-maven-plugin}
[WARNING] org.openrewrite.java.migrate.wro4j.UpgradeWro4jMavenPluginVersion
[WARNING] org.openrewrite.maven.UpgradePluginVersion: {groupId=ro.isdc.wro4j, artifactId=wro4j-maven-plugin, newVersion=1.10.1}
Nothing happens, but the version is for Java11, not for Java17.
On the other side, about jakarta, the recipe AddDependency
[WARNING] org.openrewrite.java.migrate.UpgradeToJava17
[WARNING] org.openrewrite.java.migrate.Java8toJava11
[WARNING] org.openrewrite.java.migrate.javax.AddJaxbDependencies
[WARNING] org.openrewrite.java.dependencies.AddDependency: {groupId=jakarta.xml.bind, artifactId=jakarta.xml.bind-api, version=2.3.x, onlyIfUsing=javax.xml.bind..*, acceptTransitive=true}
Add the 2.3.3 dependency but it is not enough due to packaging error with Java17, this dependency still use javax.xml.bind package.
Apart from that, I have tried to add more recipes to solve these issues:
---
type: specs.openrewrite.org/v1beta/recipe
name: com.example.MigrateToSpringBoot3_3
displayName: Upgrade Wro4j Maven plugin version
causesAnotherCycle: true
recipeList:
- org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3
- org.openrewrite.maven.UpgradePluginVersion:
groupId: ro.isdc.wro4j
artifactId: wro4j-maven-plugin
newVersion: 2.1.1
- org.openrewrite.maven.RemoveProperty:
propertyName: cobertura.version
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: jakarta.xml.bind
artifactId: jakarta.xml.bind-api
newVersion: 4.0.2
But the last recipe, UpgradeDependencyVersion, does not execute although I have tried to put causesAnotherCycle = true. So if you put this recipe com.example.MigrateToSpringBoot3_3 instead of org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3 you can see that jakarta.xml.bind-api` is not upgraded.
What is the full stack trace of any errors you encountered?
No errors, only the result is not the proper one.
Are you interested in [contributing a fix to OpenRewrite]
Currently im writing a post in spanish about it, it is pretty interesting, if I had time i would like to fix this problem.
What version of OpenRewrite are you using?
I am using:
How are you running OpenRewrite?
I'm using maven plugin on my own project.
You can check the project here:
https://github.com/mgvinuesa/spring-petclinic-openrewrite
It is a fork of spring-petclinic and you might use the branch with the name migrate_with_open_rewrite, I started with the TAG 1.5.x to migrate boot Spring Boot and Java using OpenRewrite.
What is the smallest, simplest way to reproduce the problem?
Execute the mvn command with the current configuration with Java 8.
mvn rewrite:runWhat did you expect to see?
The wro4j-maven-plugin might upgrade from 1.8.0 to 2.X due to Java17 compatibility.
The recipe that adds jakarta.xml.bind-api must include the latest version instead of 2.3.3.
What did you see instead?
Even there is a recipe to work with wro4j:
Nothing happens, but the version is for Java11, not for Java17.
On the other side, about jakarta, the recipe AddDependency
Add the 2.3.3 dependency but it is not enough due to packaging error with Java17, this dependency still use javax.xml.bind package.
Apart from that, I have tried to add more recipes to solve these issues:
But the last recipe, UpgradeDependencyVersion, does not execute although I have tried to put causesAnotherCycle = true. So if you put this recipe
com.example.MigrateToSpringBoot3_3instead oforg.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3you can see that jakarta.xml.bind-api` is not upgraded.What is the full stack trace of any errors you encountered?
No errors, only the result is not the proper one.
Are you interested in [contributing a fix to OpenRewrite]
Currently im writing a post in spanish about it, it is pretty interesting, if I had time i would like to fix this problem.