Skip to content

Commit

Permalink
Migrate to use consolidated dependency handling recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed May 23, 2023
1 parent 53cfd4c commit f25ff0b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
implementation("org.openrewrite:rewrite-java")
implementation("org.openrewrite:rewrite-gradle")
implementation("org.openrewrite:rewrite-maven")
implementation("org.openrewrite.recipe:rewrite-java-dependencies:latest.release")
runtimeOnly("org.openrewrite:rewrite-java-17")

compileOnly("org.projectlombok:lombok:latest.release")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
import org.openrewrite.java.JavaIsoVisitor;
import org.openrewrite.java.JavaParser;
import org.openrewrite.java.JavaTemplate;
import org.openrewrite.java.dependencies.UpgradeDependencyVersion;
import org.openrewrite.java.search.FindTypes;
import org.openrewrite.java.tree.J;
import org.openrewrite.java.tree.JavaType;
import org.openrewrite.java.tree.Space;
import org.openrewrite.java.tree.TypeUtils;
import org.openrewrite.marker.Markers;
import org.openrewrite.marker.SearchResult;
import org.openrewrite.maven.UpgradeDependencyVersion;

import java.time.Duration;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import org.openrewrite.Recipe;
import org.openrewrite.TreeVisitor;
import org.openrewrite.java.*;
import org.openrewrite.java.dependencies.UpgradeDependencyVersion;
import org.openrewrite.java.search.UsesType;
import org.openrewrite.java.tree.*;
import org.openrewrite.maven.UpgradeDependencyVersion;

import java.time.Duration;
import java.util.function.Supplier;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/rewrite/assertj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ recipeList:
- org.openrewrite.java.testing.assertj.JUnitAssertTrueToAssertThat
- org.openrewrite.java.testing.assertj.JUnitFailToAssertJFail
- org.openrewrite.java.testing.assertj.JUnitAssertThrowsToAssertExceptionType
- org.openrewrite.maven.AddDependency:
- org.openrewrite.java.dependencies.AddDependency:
groupId: org.assertj
artifactId: assertj-core
version: 3.x
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/rewrite/hamcrest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tags:
- hamcrest
- junit
recipeList:
- org.openrewrite.maven.AddDependency:
- org.openrewrite.java.dependencies.AddDependency:
groupId: org.hamcrest
artifactId: hamcrest
version: 2.x
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/META-INF/rewrite/junit5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,25 @@ recipeList:
- org.openrewrite.java.testing.junit5.AddMissingNested
- org.openrewrite.java.testing.hamcrest.AddHamcrestIfUsed
- org.openrewrite.java.testing.junit5.UpgradeOkHttpMockWebServer
- org.openrewrite.maven.RemoveDependency:
- org.openrewrite.java.dependencies.RemoveDependency:
groupId: junit
artifactId: junit
- org.openrewrite.maven.ExcludeDependency:
groupId: junit
artifactId: junit
- org.openrewrite.maven.RemoveDependency:
- org.openrewrite.java.dependencies.RemoveDependency:
groupId: org.junit.vintage
artifactId: junit-vintage-engine
- org.openrewrite.maven.ExcludeDependency:
groupId: org.junit.vintage
artifactId: junit-vintage-engine
- org.openrewrite.maven.AddDependency:
- org.openrewrite.java.dependencies.AddDependency:
groupId: org.junit.jupiter
artifactId: junit-jupiter
version: 5.x
onlyIfUsing: org.junit.jupiter.api.Test
acceptTransitive: true
- org.openrewrite.maven.AddDependency:
- org.openrewrite.java.dependencies.AddDependency:
groupId: org.junit.jupiter
artifactId: junit-jupiter-params
version: 5.x
Expand Down Expand Up @@ -140,7 +140,7 @@ tags:
- junit
- hamcrest
recipeList:
- org.openrewrite.maven.AddDependency:
- org.openrewrite.java.dependencies.AddDependency:
groupId: org.hamcrest
artifactId: hamcrest-junit
version: 2.x
Expand Down Expand Up @@ -218,7 +218,7 @@ recipeList:
runners:
- org.vertx.testtools.VertxUnitRunner
extension: org.vertx.testtools.VertxExtension
- org.openrewrite.maven.AddDependency:
- org.openrewrite.java.dependencies.AddDependency:
groupId: io.vertx
artifactId: vertx-junit5
version: 4.x
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/rewrite/mockito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tags:
- mockito
recipeList:
- org.openrewrite.java.testing.mockito.Mockito1to3Migration
- org.openrewrite.maven.UpgradeDependencyVersion:
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.mockito
artifactId: "*"
newVersion: 4.x
Expand Down Expand Up @@ -112,13 +112,13 @@ recipeList:
- org.openrewrite.java.testing.mockito.MockUtilsToStatic
- org.openrewrite.java.testing.junit5.MockitoJUnitToMockitoExtension
- org.openrewrite.java.testing.mockito.ReplacePowerMockito
- org.openrewrite.maven.AddDependency:
- org.openrewrite.java.dependencies.AddDependency:
groupId: org.mockito
artifactId: mockito-junit-jupiter
version: 3.x
onlyIfUsing: org.mockito.junit.jupiter.MockitoExtension
acceptTransitive: true
- org.openrewrite.maven.UpgradeDependencyVersion:
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.mockito
artifactId: "*"
newVersion: 3.x
Expand Down

0 comments on commit f25ff0b

Please sign in to comment.