diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e62ea90..1c36c8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [11, 21, 22] + java: [17, 21, 22] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-plugin.yml b/.github/workflows/release-plugin.yml index 4c7b806..9a87836 100644 --- a/.github/workflows/release-plugin.yml +++ b/.github/workflows/release-plugin.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: 11 + java-version: 17 - uses: gradle/actions/setup-gradle@v4 - run: ./gradlew publishPlugin env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 36f455a..e694489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.12.0] - 2024-12-04 +### Changed +- The minimum Java version required is now Java 17. +- Update dependencies to support newer Java versions. ## [0.11.0] - 2024-06-17 ### Changed @@ -236,7 +239,7 @@ Provided by the plugin: with a `ZapVersions.xml` from an add-on. -[Unreleased]: https://github.com/zaproxy/gradle-plugin-add-on/compare/v0.11.0...HEAD +[0.12.0]: https://github.com/zaproxy/gradle-plugin-add-on/compare/v0.11.0...v0.12.0 [0.11.0]: https://github.com/zaproxy/gradle-plugin-add-on/compare/v0.10.0...v0.11.0 [0.10.0]: https://github.com/zaproxy/gradle-plugin-add-on/compare/v0.9.0...v0.10.0 [0.9.0]: https://github.com/zaproxy/gradle-plugin-add-on/compare/v0.8.0...v0.9.0 diff --git a/README.md b/README.md index 8a89e8b..5a3274a 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ A Gradle plugin to (help) build ZAP add-ons. -The plugin requires at least Java 11 and Gradle 8.8. +The plugin requires at least Java 17 and Gradle 8.8. diff --git a/build.gradle.kts b/build.gradle.kts index ae4ebd7..0d92924 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,28 +7,28 @@ plugins { } group = "org.zaproxy.gradle" -version = "0.12.0-SNAPSHOT" +version = "0.12.0" dependencies { - implementation("commons-codec:commons-codec:1.15") - implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.9") - val flexmarkVersion = "0.42.8" + implementation("commons-codec:commons-codec:1.17.1") + implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.18.2") + val flexmarkVersion = "0.64.8" implementation("com.vladsch.flexmark:flexmark-java:$flexmarkVersion") implementation("com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:$flexmarkVersion") implementation("com.vladsch.flexmark:flexmark-ext-gfm-tasklist:$flexmarkVersion") implementation("com.vladsch.flexmark:flexmark-ext-tables:$flexmarkVersion") - implementation("io.github.classgraph:classgraph:4.8.36") - val jgitVersion = "5.6.0.201912101111-r" + implementation("io.github.classgraph:classgraph:4.8.179") + val jgitVersion = "7.1.0.202411261347-r" implementation("org.eclipse.jgit:org.eclipse.jgit:$jgitVersion") implementation("org.eclipse.jgit:org.eclipse.jgit.archive:$jgitVersion") implementation("org.zaproxy:zap-clientapi:1.14.0") - implementation("org.kohsuke:github-api:1.95") + implementation("org.kohsuke:github-api:1.326") // Include annotations used by the above library to avoid compiler warnings. compileOnly("com.google.code.findbugs:findbugs-annotations:3.0.1") compileOnly("com.infradna.tool:bridge-method-annotation:1.18") { exclude(group = "org.jenkins-ci") } - implementation("com.github.zafarkhaja:java-semver:0.9.0") + implementation("com.github.zafarkhaja:java-semver:0.10.2") } tasks.jar { @@ -41,12 +41,13 @@ tasks.jar { } java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + val javaVersion = JavaVersion.VERSION_17 + sourceCompatibility = javaVersion + targetCompatibility = javaVersion } kotlin { - jvmToolchain(11) + jvmToolchain(17) } gradlePlugin { diff --git a/src/main/java/org/zaproxy/gradle/addon/internal/model/ReleaseState.java b/src/main/java/org/zaproxy/gradle/addon/internal/model/ReleaseState.java index c94a6ab..28caaea 100644 --- a/src/main/java/org/zaproxy/gradle/addon/internal/model/ReleaseState.java +++ b/src/main/java/org/zaproxy/gradle/addon/internal/model/ReleaseState.java @@ -23,14 +23,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import java.io.File; import java.io.IOException; import org.zaproxy.gradle.addon.internal.BuildException; /** The release state computed from {@code gradle.properties} files. */ -@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) @JsonInclude(value = Include.NON_EMPTY) public class ReleaseState { diff --git a/src/main/java/org/zaproxy/gradle/addon/internal/tasks/CreatePullRequest.java b/src/main/java/org/zaproxy/gradle/addon/internal/tasks/CreatePullRequest.java index 5a7a216..c09942a 100644 --- a/src/main/java/org/zaproxy/gradle/addon/internal/tasks/CreatePullRequest.java +++ b/src/main/java/org/zaproxy/gradle/addon/internal/tasks/CreatePullRequest.java @@ -137,7 +137,7 @@ public void pullRequest() throws Exception { .head(ghUser.getName() + ":" + getBranchName().get()) .state(GHIssueState.OPEN) .list() - .asList(); + .toList(); String description = getPullRequestDescription().getOrElse(getCommitDescription().get()); if (pulls.isEmpty()) { diff --git a/src/main/java/org/zaproxy/gradle/addon/internal/tasks/PrepareNextDevIter.java b/src/main/java/org/zaproxy/gradle/addon/internal/tasks/PrepareNextDevIter.java index 6bf815f..425751d 100644 --- a/src/main/java/org/zaproxy/gradle/addon/internal/tasks/PrepareNextDevIter.java +++ b/src/main/java/org/zaproxy/gradle/addon/internal/tasks/PrepareNextDevIter.java @@ -83,7 +83,7 @@ private static String bumpVersion(String version) { } try { - return Version.valueOf(version).incrementMinorVersion().toString(); + return Version.parse(version).nextMinorVersion().toString(); } catch (IllegalArgumentException | ParseException e) { throw new InvalidUserDataException( "Failed to parse the current version: " + version, e); diff --git a/src/main/java/org/zaproxy/gradle/addon/misc/ConvertMarkdownToHtml.java b/src/main/java/org/zaproxy/gradle/addon/misc/ConvertMarkdownToHtml.java index e861cea..96e006d 100644 --- a/src/main/java/org/zaproxy/gradle/addon/misc/ConvertMarkdownToHtml.java +++ b/src/main/java/org/zaproxy/gradle/addon/misc/ConvertMarkdownToHtml.java @@ -24,10 +24,9 @@ import com.vladsch.flexmark.ext.tables.TablesExtension; import com.vladsch.flexmark.html.HtmlRenderer; import com.vladsch.flexmark.parser.Parser; -import com.vladsch.flexmark.util.options.MutableDataSet; +import com.vladsch.flexmark.util.data.MutableDataSet; import java.io.IOException; import java.io.Writer; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.Arrays; import org.gradle.api.DefaultTask; @@ -80,10 +79,7 @@ public void convert() throws IOException { Parser parser = Parser.builder(options).build(); HtmlRenderer renderer = HtmlRenderer.builder(options).build(); - String changes = - new String( - Files.readAllBytes(markdown.get().getAsFile().toPath()), - StandardCharsets.UTF_8); + String changes = Files.readString(markdown.get().getAsFile().toPath()); try (Writer writer = Files.newBufferedWriter(html.get().getAsFile().toPath())) { renderer.render(parser.parse(changes), writer); } diff --git a/src/main/java/org/zaproxy/gradle/addon/misc/PrepareAddOnNextDevIter.java b/src/main/java/org/zaproxy/gradle/addon/misc/PrepareAddOnNextDevIter.java index cf3d341..d42c5ad 100644 --- a/src/main/java/org/zaproxy/gradle/addon/misc/PrepareAddOnNextDevIter.java +++ b/src/main/java/org/zaproxy/gradle/addon/misc/PrepareAddOnNextDevIter.java @@ -120,7 +120,7 @@ private static String bumpVersion(String version) { } try { - return Version.valueOf(version).incrementMinorVersion().toString(); + return Version.parse(version).nextMinorVersion().toString(); } catch (IllegalArgumentException | ParseException e) { throw new InvalidUserDataException( "Failed to parse the current version: " + version, e);