File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
main/resources/META-INF/rewrite
test/java/org/openrewrite/java/migrate/jakarta Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ recipeList:
112112 newGroupId : jakarta.annotation
113113 newArtifactId : jakarta.annotation-api
114114 newVersion : 2.0.x
115+ - org.openrewrite.java.dependencies.UpgradeDependencyVersion :
116+ groupId : jakarta.annotation
117+ artifactId : jakarta.annotation-api
118+ newVersion : 2.0.x
115119 - org.openrewrite.java.ChangePackage :
116120 oldPackageName : javax.annotation
117121 newPackageName : jakarta.annotation
Original file line number Diff line number Diff line change @@ -574,7 +574,7 @@ public class TestApplication {
574574 }
575575
576576 @ Test
577- void doNothingIfNotFoundTransitiveDependency () {
577+ void upgradeAnnotationApiFromV1ToV2 () {
578578 rewriteRun (
579579 spec -> spec .parser (JavaParser .fromJavaVersion ().dependsOn (javaxServlet )),
580580 mavenProject (
@@ -592,8 +592,7 @@ public class TestApplication {
592592 //language=xml
593593 pomXml (
594594 """
595- <?xml version="1.0" encoding="UTF-8"?>
596- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
595+ <project>
597596 <modelVersion>4.0.0</modelVersion>
598597 <groupId>org.sample</groupId>
599598 <artifactId>sample</artifactId>
@@ -606,6 +605,21 @@ public class TestApplication {
606605 </dependency>
607606 </dependencies>
608607 </project>
608+ """ ,
609+ """
610+ <project>
611+ <modelVersion>4.0.0</modelVersion>
612+ <groupId>org.sample</groupId>
613+ <artifactId>sample</artifactId>
614+ <version>1.0.0</version>
615+ <dependencies>
616+ <dependency>
617+ <groupId>jakarta.annotation</groupId>
618+ <artifactId>jakarta.annotation-api</artifactId>
619+ <version>2.0.0</version>
620+ </dependency>
621+ </dependencies>
622+ </project>
609623 """
610624 )
611625 )
You can’t perform that action at this time.
0 commit comments