What version of OpenRewrite are you using?
I am using
- rewrite-migrate-java 1.4.2
- Maven plugin 5.32.1
How are you running OpenRewrite?
CLI
Problem statement
The UpgradeJavaVersion recipe currently does nothing when no Java version is specified in a project's pom.xml file. So, in the case where a user runs the org.openrewrite.java.migrate.UpgradeBuildToJava21 recipe without setting a compiler version in their pom.xml, the app would still compile at Maven's default compile version, which I believe is 1.8.
How To Reproduce
Remove the maven.compiler.target, and maven.compiler.source properties in the pom.xml file and execute dryRun with any UpgradeJavaVersion recipe specified as an active recipe. You will see that the UpgradeJavaVersion made no changes, indicating the app is still building at the default maven compiler version.
Expected behavior
I think these recipes should instead set the source and target compile version when no values were previously specified
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
CLI
Problem statement
The UpgradeJavaVersion recipe currently does nothing when no Java version is specified in a project's pom.xml file. So, in the case where a user runs the
org.openrewrite.java.migrate.UpgradeBuildToJava21recipe without setting a compiler version in their pom.xml, the app would still compile at Maven's default compile version, which I believe is 1.8.How To Reproduce
Remove the
maven.compiler.target, andmaven.compiler.sourceproperties in the pom.xml file and execute dryRun with any UpgradeJavaVersion recipe specified as an active recipe. You will see that the UpgradeJavaVersion made no changes, indicating the app is still building at the default maven compiler version.Expected behavior
I think these recipes should instead set the source and target compile version when no values were previously specified