Skip to content

Commit 2db46d6

Browse files
authored
Merge pull request #490 from jonesbusy/feature/json-path
Add JSON path API plugin to `recipes.yml`
2 parents da6f99e + 463d196 commit 2db46d6

2 files changed

Lines changed: 46 additions & 23 deletions

File tree

  • plugin-modernizer-cli/src/test/resources/replace-by-api-plugins
  • plugin-modernizer-core/src/main/resources/META-INF/rewrite

plugin-modernizer-cli/src/test/resources/replace-by-api-plugins/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@
8484
<version>20240303</version>
8585
</dependency>
8686

87+
<!-- This should be replaced -->
88+
<dependency>
89+
<groupId>com.jayway.jsonpath</groupId>
90+
<artifactId>json-path</artifactId>
91+
<version>2.9.0</version>
92+
</dependency>
93+
8794
<!-- This should NOT be replaced -->
8895
<dependency>
8996
<groupId>org.ow2.asm</groupId>

plugin-modernizer-core/src/main/resources/META-INF/rewrite/recipes.yml

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ displayName: Use API plugin instead of direct dependency
9797
tags: ['developer']
9898
description: Use API plugins instead of direct dependency
9999
recipeList:
100-
# More API plugin on the list
101100
- io.jenkins.tools.pluginmodernizer.UseJsonApiPlugin
101+
- io.jenkins.tools.pluginmodernizer.UseJsonPathApiPlugin
102102
- io.jenkins.tools.pluginmodernizer.UseGsonApiPlugin
103103
- io.jenkins.tools.pluginmodernizer.UseCompressApiPlugin
104104
- io.jenkins.tools.pluginmodernizer.UseJodaTimeApiPlugin
@@ -124,28 +124,44 @@ recipeList:
124124
artifactId: json
125125
---
126126
type: specs.openrewrite.org/v1beta/recipe
127+
name: io.jenkins.tools.pluginmodernizer.UseJsonPathApiPlugin
128+
displayName: Use JSON Path API plugin instead of direct dependency
129+
description: Use JSON Path API plugin instead of direct dependency
130+
tags: ['developer']
131+
preconditions:
132+
- io.jenkins.tools.pluginmodernizer.conditions.IsUsingRecommendCoreVersion
133+
recipeList:
134+
- org.openrewrite.jenkins.ReplaceLibrariesWithApiPlugin:
135+
pluginGroupId: io.jenkins.plugins
136+
pluginArtifactId: json-path-api
137+
pluginVersion: 2.9.0-118.v7f23ed82a_8b_8
138+
replaces:
139+
- groupId: com.jayway.jsonpath
140+
artifactId: json-path
141+
---
142+
type: specs.openrewrite.org/v1beta/recipe
127143
name: io.jenkins.tools.pluginmodernizer.UseAsmApiPlugin
128144
displayName: Use ASM API plugin instead of direct dependency
129145
description: Use ASM API plugin instead of direct dependency
130146
tags: ['developer']
131147
preconditions:
132148
- io.jenkins.tools.pluginmodernizer.conditions.IsUsingCoreVersionWithASMRemoved
133149
recipeList:
134-
- org.openrewrite.jenkins.ReplaceLibrariesWithApiPlugin:
135-
pluginGroupId: io.jenkins.plugins
136-
pluginArtifactId: asm-api
137-
pluginVersion: 9.7.1-97.v4cc844130d97
138-
replaces:
139-
- groupId: org.ow2.asm
140-
artifactId: asm
141-
- groupId: org.ow2.asm
142-
artifactId: asm-analysis
143-
- groupId: org.ow2.asm
144-
artifactId: asm-commons
145-
- groupId: org.ow2.asm
146-
artifactId: asm-tree
147-
- groupId: org.ow2.asm
148-
artifactId: asm-util
150+
- org.openrewrite.jenkins.ReplaceLibrariesWithApiPlugin:
151+
pluginGroupId: io.jenkins.plugins
152+
pluginArtifactId: asm-api
153+
pluginVersion: 9.7.1-97.v4cc844130d97
154+
replaces:
155+
- groupId: org.ow2.asm
156+
artifactId: asm
157+
- groupId: org.ow2.asm
158+
artifactId: asm-analysis
159+
- groupId: org.ow2.asm
160+
artifactId: asm-commons
161+
- groupId: org.ow2.asm
162+
artifactId: asm-tree
163+
- groupId: org.ow2.asm
164+
artifactId: asm-util
149165
---
150166
type: specs.openrewrite.org/v1beta/recipe
151167
name: io.jenkins.tools.pluginmodernizer.UseJodaTimeApiPlugin
@@ -155,13 +171,13 @@ tags: ['developer']
155171
preconditions:
156172
- io.jenkins.tools.pluginmodernizer.conditions.IsUsingRecommendCoreVersion
157173
recipeList:
158-
- org.openrewrite.jenkins.ReplaceLibrariesWithApiPlugin:
159-
pluginGroupId: io.jenkins.plugins
160-
pluginArtifactId: joda-time-api
161-
pluginVersion: 2.13.0-93.v9934da_29b_a_e9
162-
replaces:
163-
- groupId: joda-time
164-
artifactId: joda-time
174+
- org.openrewrite.jenkins.ReplaceLibrariesWithApiPlugin:
175+
pluginGroupId: io.jenkins.plugins
176+
pluginArtifactId: joda-time-api
177+
pluginVersion: 2.13.0-93.v9934da_29b_a_e9
178+
replaces:
179+
- groupId: joda-time
180+
artifactId: joda-time
165181
---
166182
type: specs.openrewrite.org/v1beta/recipe
167183
name: io.jenkins.tools.pluginmodernizer.UseGsonApiPlugin

0 commit comments

Comments
 (0)