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 235abc5d5b..7c9347f41e 100644 --- a/src/main/resources/META-INF/rewrite/java-version-11.yml +++ b/src/main/resources/META-INF/rewrite/java-version-11.yml @@ -57,7 +57,12 @@ recipeList: - org.openrewrite.java.migrate.cobertura.RemoveCoberturaMavenPlugin - org.openrewrite.java.migrate.wro4j.UpgradeWro4jMavenPluginVersion - org.openrewrite.java.migrate.jacoco.UpgradeJaCoCoMavenPluginVersion - - org.openrewrite.java.migrate.JavaVersion11 + - org.openrewrite.java.migrate.UpgradeJavaVersion: + version: 11 + - org.openrewrite.maven.UpgradePluginVersion: + groupId: org.apache.maven.plugins + artifactId: maven-compiler-plugin + newVersion: 3.6.2 # Disabled due to null safety issues in the current implementation # https://github.com/openrewrite/rewrite-migrate-java/issues/250 # - org.openrewrite.java.migrate.util.JavaUtilAPIs @@ -71,18 +76,6 @@ recipeList: --- type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.JavaVersion11 -displayName: Change Maven Java version property values to 11 -description: Change maven.compiler.source and maven.compiler.target values to 11. -recipeList: - - org.openrewrite.java.migrate.UpgradeJavaVersion: - version: 11 - - org.openrewrite.maven.UpgradePluginVersion: - groupId: org.apache.maven.plugins - artifactId: maven-compiler-plugin - newVersion: 3.6.2 ---- -type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.migrate.javax.AddJaxbDependencies displayName: Add explicit JAXB dependencies description: > diff --git a/src/main/resources/META-INF/rewrite/java-version-17.yml b/src/main/resources/META-INF/rewrite/java-version-17.yml index 0e9d4dc62e..1d4df01fb5 100644 --- a/src/main/resources/META-INF/rewrite/java-version-17.yml +++ b/src/main/resources/META-INF/rewrite/java-version-17.yml @@ -27,7 +27,8 @@ tags: - java17 recipeList: - org.openrewrite.java.migrate.Java8toJava11 - - org.openrewrite.java.migrate.JavaVersion17 + - org.openrewrite.java.migrate.UpgradeJavaVersion: + version: 17 - org.openrewrite.java.migrate.lang.StringFormatted - org.openrewrite.github.SetupJavaUpgradeJavaVersion: minimumJavaMajorVersion: 17 @@ -57,17 +58,6 @@ recipeList: - org.openrewrite.java.migrate.RemovedFileIOFinalizeMethods --- type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.JavaVersion17 -displayName: Change Maven Java version property values to 17 -description: Change maven.compiler.source and maven.compiler.target values to 17. -tags: - - java17 - - compiler -recipeList: - - org.openrewrite.java.migrate.UpgradeJavaVersion: - version: 17 ---- -type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.migrate.DeprecatedJavaxSecurityCert displayName: Use `java.security.cert` instead of `javax.security.cert` description: The `javax.security.cert` package has been deprecated for removal. diff --git a/src/main/resources/META-INF/rewrite/java-version-21.yml b/src/main/resources/META-INF/rewrite/java-version-21.yml index e54749d031..309c481658 100644 --- a/src/main/resources/META-INF/rewrite/java-version-21.yml +++ b/src/main/resources/META-INF/rewrite/java-version-21.yml @@ -25,7 +25,8 @@ tags: - java21 recipeList: - org.openrewrite.java.migrate.UpgradeToJava17 - - org.openrewrite.java.migrate.JavaVersion21 + - org.openrewrite.java.migrate.UpgradeJavaVersion: + version: 21 - org.openrewrite.java.migrate.RemoveIllegalSemicolons - org.openrewrite.java.migrate.lang.ThreadStopUnsupported - org.openrewrite.java.migrate.net.URLConstructorsToURIRecipes @@ -61,17 +62,6 @@ recipeList: --- type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.migrate.JavaVersion21 -displayName: Change Maven Java version property values to 21 -description: Change maven.compiler.source and maven.compiler.target values to 21. -tags: - - java21 - - compiler -recipeList: - - org.openrewrite.java.migrate.UpgradeJavaVersion: - version: 21 ---- -type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.migrate.util.SequencedCollection displayName: Adopt `SequencedCollection` description: Replace older code patterns with `SequencedCollection` methods, as per https://openjdk.org/jeps/431. diff --git a/src/test/java/org/openrewrite/java/migrate/UpdateMavenToJava11Test.java b/src/test/java/org/openrewrite/java/migrate/UpdateMavenToJava11Test.java deleted file mode 100644 index 2e2dac6ad8..0000000000 --- a/src/test/java/org/openrewrite/java/migrate/UpdateMavenToJava11Test.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2021 the original author or authors. - *
- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *
- * https://www.apache.org/licenses/LICENSE-2.0 - *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.openrewrite.java.migrate;
-
-import org.junit.jupiter.api.Test;
-import org.openrewrite.DocumentExample;
-import org.openrewrite.Issue;
-import org.openrewrite.config.Environment;
-import org.openrewrite.test.RecipeSpec;
-import org.openrewrite.test.RewriteTest;
-
-import static org.openrewrite.java.Assertions.version;
-import static org.openrewrite.maven.Assertions.pomXml;
-
-class UpdateMavenToJava11Test implements RewriteTest {
-
- @Override
- public void defaults(RecipeSpec spec) {
- spec.recipe(Environment.builder()
- .scanRuntimeClasspath("org.openrewrite.java.migrate")
- .build().activateRecipes("org.openrewrite.java.migrate.JavaVersion11"));
- }
-
- @DocumentExample
- @Test
- void changeJavaVersion() {
- //language=xml
- rewriteRun(
- version(
- pomXml(
- """
-