Skip to content

Commit

Permalink
jacoco upgrade now includes arbitrary jacoco deps (eg agent), always … (
Browse files Browse the repository at this point in the history
#471)

* jacoco upgrade now includes arbitrary jacoco deps (eg agent), always sends to highest patch version, and happens in the java 6 recipe (and therefore runs at every java upgrade)

* test fix

* Remove constant from test to guard against new releases

---------

Co-authored-by: Tim te Beek <[email protected]>
  • Loading branch information
nmck257 and timtebeek authored May 2, 2024
1 parent 2d67368 commit c82c73a
Show file tree
Hide file tree
Showing 7 changed files with 329 additions and 96 deletions.
13 changes: 8 additions & 5 deletions src/main/resources/META-INF/rewrite/jacoco.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ name: 'JaCoCo'
packageName: org.openrewrite.java.migrate.jacoco
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.jacoco.UpgradeJaCoCoMavenPluginVersion
displayName: Upgrade JaCoCo Maven plugin version
description: This recipe will upgrade the JaCoCo Maven plugin to a more recent version compatible with Java 11.
name: org.openrewrite.java.migrate.jacoco.UpgradeJaCoCo
displayName: Upgrade JaCoCo
description: This recipe will upgrade JaCoCo to the latest patch version, which traditionally advertises full backwards compatibility for older Java versions.
tags:
- java11
- jacoco
recipeList:
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.jacoco
artifactId: "*"
newVersion: 0.8.x
- org.openrewrite.maven.UpgradePluginVersion:
groupId: org.jacoco
artifactId: jacoco-maven-plugin
newVersion: 0.8.8
newVersion: 0.8.x
1 change: 0 additions & 1 deletion src/main/resources/META-INF/rewrite/java-version-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ recipeList:
- org.openrewrite.java.migrate.javax.JavaxXmlStreamAPIs
- org.openrewrite.java.migrate.cobertura.RemoveCoberturaMavenPlugin
- org.openrewrite.java.migrate.wro4j.UpgradeWro4jMavenPluginVersion
- org.openrewrite.java.migrate.jacoco.UpgradeJaCoCoMavenPluginVersion
- org.openrewrite.java.migrate.UpgradeJavaVersion:
version: 11
- org.openrewrite.maven.UpgradePluginVersion:
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/META-INF/rewrite/java-version-21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ recipeList:
- org.openrewrite.gradle.UpdateGradleWrapper:
version: 8.5
addIfMissing: false
- org.openrewrite.maven.UpgradePluginVersion:
groupId: org.jacoco
artifactId: jacoco-maven-plugin
newVersion: 0.8.+
- org.openrewrite.maven.UpgradePluginVersion:
groupId: com.sonatype.clm
artifactId: clm-maven-plugin
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/rewrite/java-version-6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ name: org.openrewrite.java.migrate.JREWrapperInterface
displayName: Add missing `isWrapperFor` and `unwrap` methods.
description: Add method implementations stubs to classes that implement `java.sql.Wrapper`.
recipeList:
- org.openrewrite.java.migrate.jacoco.UpgradeJaCoCo
- org.openrewrite.java.migrate.AddMissingMethodImplementation:
fullyQualifiedClassName: java.sql.Wrapper
methodPattern: "*..* isWrapperFor(..)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class UpgradeToJava6Test implements RewriteTest {

@Override
public void defaults(RecipeSpec spec) {
spec.recipeFromResource("/META-INF/rewrite/java-version-6.yml", "org.openrewrite.java.migrate.UpgradeToJava6")
spec.recipeFromResources("org.openrewrite.java.migrate.UpgradeToJava6")
.allSources(src -> src.markers(javaVersion(6)));
}

Expand Down

This file was deleted.

Loading

0 comments on commit c82c73a

Please sign in to comment.