Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/rewrite/jakarta-ee-10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,12 @@ recipeList:
groupId: org.apache.shiro
artifactId: "*"
newClassifier: jakarta
changeManagedDependency: true
- org.openrewrite.gradle.ChangeDependencyClassifier:
groupId: org.apache.shiro
artifactId: "*"
newClassifier: jakarta
changeManagedDependency: true
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.apache.shiro
artifactId: "*"
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/rewrite/jakarta-ee-9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,12 @@ recipeList:
groupId: org.ehcache
artifactId: ehcache
newClassifier: jakarta
changeManagedDependency: true
- org.openrewrite.maven.ChangeDependencyClassifier:
groupId: org.ehcache
artifactId: ehcache-transactions
newClassifier: jakarta
changeManagedDependency: true

---
type: specs.openrewrite.org/v1beta/recipe
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/rewrite/jakarta-faces-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ recipeList:
groupId: org.primefaces
artifactId: primefaces
newClassifier: jakarta
changeManagedDependency: true
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.primefaces
artifactId: primefaces
Expand All @@ -396,6 +397,7 @@ recipeList:
groupId: org.primefaces.extensions
artifactId: primefaces-extensions
newClassifier: jakarta
changeManagedDependency: true
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.primefaces.extensions
artifactId: primefaces-extensions
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/rewrite/jakarta-faces-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ recipeList:
groupId: org.primefaces
artifactId: primefaces
newClassifier: jakarta
changeManagedDependency: true
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.primefaces
artifactId: primefaces
Expand All @@ -283,6 +284,7 @@ recipeList:
groupId: org.primefaces.extensions
artifactId: primefaces-extensions
newClassifier: jakarta
changeManagedDependency: true
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.primefaces.extensions
artifactId: primefaces-extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,18 @@

import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;
import org.openrewrite.config.Environment;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

import static org.assertj.core.api.Assertions.assertThat;
import static org.openrewrite.java.Assertions.mavenProject;
import static org.openrewrite.maven.Assertions.pomXml;

class EhcacheJavaxtoJakartaTest implements RewriteTest {
class EhcacheJavaxToJakartaTest implements RewriteTest {

@Override
public void defaults(RecipeSpec spec) {
spec.recipe(Environment.builder()
.scanRuntimeClasspath("org.openrewrite.java.migrate")
.build()
.activateRecipes("org.openrewrite.java.migrate.jakarta.EhcacheJavaxToJakarta"));
spec.recipeFromResources("org.openrewrite.java.migrate.jakarta.EhcacheJavaxToJakarta");
}

@DocumentExample
Expand Down Expand Up @@ -95,4 +92,76 @@ void migrateEhcacheDependencies() {
)
);
}

@Test
void multiModuleManagedDependencyClassifierChanged() {
rewriteRun(
mavenProject("parent",
pomXml(
"""
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.2.3</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.9.9</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
""",
spec -> spec.after(actual ->
assertThat(actual)
.containsPattern("<version>3\\.10\\.\\d+</version>")
.contains("<classifier>jakarta</classifier>")
.actual())
)
),
mavenProject("child",
pomXml(
"""
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.2.3</version>
</parent>
<artifactId>child</artifactId>
<dependencies>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
</dependencies>
</project>
""",
"""
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.2.3</version>
</parent>
<artifactId>child</artifactId>
<dependencies>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<classifier>jakarta</classifier>
</dependency>
</dependencies>
</project>
"""
)
)
);
}
}