Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor polish related to Java 17 and 21 bumps #398

Merged
merged 2 commits into from
Jan 22, 2024
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
4 changes: 0 additions & 4 deletions src/main/resources/META-INF/rewrite/java-version-17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ recipeList:
groupId: org.apache.maven.plugins
artifactId: maven-checkstyle-plugin
newVersion: 3.x
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.projectlombok
artifactId: lombok
newVersion: 1.18.22
- org.openrewrite.maven.UpgradePluginVersion:
groupId: com.sonatype.clm
artifactId: clm-maven-plugin
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/META-INF/rewrite/java-version-21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ recipeList:
- org.openrewrite.java.migrate.util.UseLocaleOf
- org.openrewrite.staticanalysis.ReplaceDeprecatedRuntimeExecMethods
- org.openrewrite.github.SetupJavaUpgradeJavaVersion
# GitHub Actions bump needs Gradle Wrapper bump too https://docs.gradle.org/current/userguide/compatibility.html#java
- org.openrewrite.gradle.UpdateGradleWrapper:
version: 8.5
- org.openrewrite.maven.UpgradePluginVersion:
groupId: org.jacoco
artifactId: jacoco-maven-plugin
newVersion: 0.8.11
newVersion: 0.8.+
- org.openrewrite.maven.UpgradePluginVersion:
groupId: com.sonatype.clm
artifactId: clm-maven-plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

import java.util.regex.Pattern;

import static org.assertj.core.api.Assertions.assertThat;
import static org.openrewrite.java.Assertions.*;
import static org.openrewrite.maven.Assertions.pomXml;
Expand Down Expand Up @@ -483,4 +485,46 @@ private static void agentmain(String agentArgs, String inst) {
), 17)
);
}

@Test
void lombokBumpedGoingTo17() {
rewriteRun(
//language=xml
pomXml(
"""
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.22</version>
</dependency>
</dependencies>
</project>
""",
spec -> spec.after(actual ->
"""
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>%s</version>
</dependency>
</dependencies>
</project>
""".formatted(Pattern.compile("<version>(1\\.18.*)</version>")
.matcher(actual).results().findFirst().orElseThrow().group(1))
)
)
);
}
}