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
4 changes: 2 additions & 2 deletions .gitpod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# specifically tailored for building Jenkins plugins. It includes the installation of Maven,
# cloning of two specific Jenkins plugin repositories, and building these plugins using Maven.

# Start from a base image that includes JDK 17 and Git. This serves as the foundation for the development environment.
FROM gitpod/workspace-java-17
# Start from a base image that includes JDK 21 and Git. This serves as the foundation for the development environment.
FROM gitpod/workspace-java-21

# Define the versions of the JDKs to install. This is used by the `sdk install java` command to install the specified JDK.
ENV JDK8_PACKAGE=8.0.462-tem
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ buildPlugin(
useContainerAgent: false,
configurations: [
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
[platform: 'windows', jdk: 21],
])
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Learn more at [this project page](https://www.jenkins.io/projects/gsoc/2024/proj

### Requirements
- Maven version 3.9.7 or later, or mvnd
- Java 17 or Java 21 ([Eclipse Temurin](https://adoptium.net/temurin/releases) recommended)
- Java 21 ([Eclipse Temurin](https://adoptium.net/temurin/releases) recommended)

### Build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ private InvocationRequest buildRequest(String args, Path logFile) {
properties.put("set.changelist", "true");
}
properties.put("exec.executable", javaHome.resolve("bin/java").toString());
LOG.debug("Using java executable: {}", properties.get("exec.executable"));
properties.put("test.cliArgs", args);
request.setProperties(properties);

Expand Down
6 changes: 0 additions & 6 deletions plugin-modernizer-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
<exclusions>
<exclusion>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java-21</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public void start() {
LOG.debug("Plugin Health Score Url: {}", config.getPluginHealthScore());
LOG.debug("Installation Stats Url: {}", config.getPluginStatsInstallations());
LOG.debug("Cache Path: {}", config.getCachePath());
LOG.debug("Java Version: {}", getJavaVersion());
LOG.debug("Maven Home: {}", config.getMavenHome());
LOG.debug("Maven Local Repository: {}", config.getMavenLocalRepo());
LOG.debug("Dry Run: {}", config.isDryRun());
Expand Down Expand Up @@ -237,7 +238,7 @@ private void process(Plugin plugin) {
plugin.checkoutBranch(ghService);

// Minimum JDK to run openrewrite
plugin.withJDK(JDK.JAVA_17);
plugin.withJDK(JDK.JAVA_21);

// Collect metadata and move metadata from the target directory of the plugin to the common cache
if (!plugin.hasMetadata() || config.isFetchMetadataOnly()) {
Expand Down Expand Up @@ -348,7 +349,7 @@ private void process(Plugin plugin) {

// Recollect metadata after modernization
if (!config.isFetchMetadataOnly()) {
plugin.withJDK(JDK.JAVA_17);
plugin.withJDK(JDK.JAVA_21);
plugin.clean(mavenInvoker);
collectMetadata(plugin, false);
LOG.debug(
Expand Down Expand Up @@ -416,7 +417,7 @@ private void process(Plugin plugin) {
*/
private void collectMetadata(Plugin plugin, boolean retryAfterFirstCompile) {
LOG.trace("Collecting metadata for plugin {}... Please be patient", plugin.getName());
plugin.withJDK(JDK.JAVA_17);
plugin.withJDK(JDK.JAVA_21);
try {
plugin.collectMetadata(mavenInvoker);
if (plugin.hasErrors()) {
Expand All @@ -435,7 +436,7 @@ private void collectMetadata(Plugin plugin, boolean retryAfterFirstCompile) {
plugin.getName());
plugin.raiseLastError();
}
plugin.withJDK(JDK.JAVA_17);
plugin.withJDK(JDK.JAVA_21);
plugin.collectMetadata(mavenInvoker);
} else {
LOG.info("Failed to collect metadata for plugin {}. Not retrying.", plugin.getName());
Expand Down Expand Up @@ -539,7 +540,7 @@ private JDK verifyPlugin(Plugin plugin) {
// Determine the JDK
JDK jdk;
if (metadata.getJdks() == null || metadata.getJdks().isEmpty()) {
jdk = JDK.JAVA_17;
jdk = JDK.JAVA_21;
LOG.info(
"No JDKs found in metadata for plugin {}. Using same JDK as rewrite for verification",
plugin.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ public void collectMetadata(MavenInvoker maven) {
* @param maven The maven invoker instance
*/
public void runOpenRewrite(MavenInvoker maven) {
withJDK(JDK.JAVA_17);
withJDK(JDK.JAVA_21);
if (config.isFetchMetadataOnly()) {
LOG.info("Skipping OpenRewrite recipe application for plugin {} as only metadata is required", name);
return;
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<!-- Reproducible builds -->
<project.build.outputTimestamp>2024-01-01T00:00:00Z</project.build.outputTimestamp>

<maven.compiler.release>21</maven.compiler.release>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -391,8 +392,8 @@
<configuration>
<rules>
<requireJavaVersion>
<version>17,21</version>
<message>Project requires Java 17 or Java 21</message>
<version>21</version>
<message>Project Java 21</message>
</requireJavaVersion>
</rules>
</configuration>
Expand Down
Loading