Skip to content

Commit 1a09ece

Browse files
committed
Update Gradle, ZAP, and Java
Update Gradle Wrapper to 8.13 and plugins. Update ZAP to 2.16. Update dependencies. Use Java 17 which is the one that ZAP is targeting. Address deprecations in the build and in a test. Signed-off-by: thc202 <[email protected]>
1 parent b6f9836 commit 1a09ece

13 files changed

+31
-22
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
java: [11, 22]
14+
java: [17, 22]
1515

1616
steps:
1717
- uses: actions/checkout@v4

.github/workflows/codeql.yml

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v4
27+
- uses: actions/setup-java@v4
28+
with:
29+
distribution: 'temurin'
30+
java-version: 17
2731
- uses: github/codeql-action/init@v3
2832
with:
2933
languages: ${{ matrix.language }}

.github/workflows/crowdin-upload-files.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
uses: actions/setup-java@v4
1414
with:
1515
distribution: 'temurin'
16-
java-version: 11
16+
java-version: 17
1717
- name: Upload Files
1818
env:
1919
CROWDIN_AUTH_TOKEN: ${{ secrets.ZAPBOT_CROWDIN_TOKEN }}

.github/workflows/prepare-release-add-on.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/setup-java@v4
1717
with:
1818
distribution: 'temurin'
19-
java-version: 11
19+
java-version: 17
2020
- name: Prepare Release and Create Pull Request
2121
env:
2222
ZAPBOT_TOKEN: ${{ secrets.ZAPBOT_TOKEN }}

.github/workflows/release-add-on.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/setup-java@v4
2121
with:
2222
distribution: 'temurin'
23-
java-version: 11
23+
java-version: 17
2424
- name: Generate Release State
2525
run: ./gradlew generateReleaseStateLastCommit
2626
- name: Build and Release Add-On

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010
- Extender script 'ScanMonitor.js'
1111

1212
### Changed
13+
- Update minimum ZAP version to 2.16.0 and compile with Java 17.
1314
- Add cautionary note to help and readme.
1415
- Maintenance and documentation changes.
1516

build.gradle.kts

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import org.zaproxy.gradle.addon.misc.ConvertMarkdownToHtml
88

99
plugins {
1010
`java-library`
11-
id("org.zaproxy.add-on") version "0.11.0"
12-
id("org.zaproxy.crowdin") version "0.4.0"
11+
id("org.zaproxy.add-on") version "0.13.1"
12+
id("org.zaproxy.crowdin") version "0.6.0"
1313
id("com.diffplug.spotless")
14-
id("com.github.node-gradle.node") version "7.0.2"
14+
id("com.github.node-gradle.node") version "7.1.0"
1515
id("org.zaproxy.common")
1616
}
1717

@@ -22,7 +22,7 @@ val scriptsDir = layout.buildDirectory.dir("scripts")
2222
zapAddOn {
2323
addOnId.set("communityScripts")
2424
addOnName.set("Community Scripts")
25-
zapVersion.set("2.15.0")
25+
zapVersion.set("2.16.0")
2626
addOnStatus.set(AddOnStatus.ALPHA)
2727

2828
releaseLink.set("https://github.com/zaproxy/community-scripts/compare/v@[email protected]@CURRENT_VERSION@")
@@ -49,20 +49,20 @@ crowdin {
4949
}
5050

5151
dependencies {
52-
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
52+
testImplementation("org.junit.jupiter:junit-jupiter:5.12.0")
5353
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
5454

55-
testImplementation("commons-io:commons-io:2.16.1")
56-
testImplementation("org.assertj:assertj-core:3.26.0")
57-
testImplementation("org.apache.commons:commons-lang3:3.14.0")
55+
testImplementation("commons-io:commons-io:2.18.0")
56+
testImplementation("org.assertj:assertj-core:3.27.3")
57+
testImplementation("org.apache.commons:commons-lang3:3.17.0")
5858

5959
// The following versions should match the ones of the add-ons.
6060
testImplementation("org.codehaus.groovy:groovy-all:3.0.14")
6161
val graalJsVersion = "22.3.3"
6262
testImplementation("org.graalvm.js:js:$graalJsVersion")
6363
testImplementation("org.graalvm.js:js-scriptengine:$graalJsVersion")
6464
testImplementation("org.jruby:jruby-complete:1.7.4")
65-
testImplementation("org.zaproxy:zest:0.21.0")
65+
testImplementation("org.zaproxy:zest:0.24.0")
6666
testImplementation("org.python:jython-standalone:2.7.2")
6767
}
6868

@@ -92,7 +92,7 @@ var scriptTypes =
9292
"websocketpassive",
9393
)
9494

95-
val syncScriptsDirTask by tasks.creating(Sync::class) {
95+
val syncScriptsDirTask by tasks.registering(Sync::class) {
9696
into(scriptsDir.get().dir(project.name))
9797

9898
scriptTypes.forEach {
@@ -107,15 +107,15 @@ tasks.named(AddOnPlugin.GENERATE_MANIFEST_TASK_NAME) {
107107
}
108108

109109
java {
110-
val javaVersion = JavaVersion.VERSION_11
110+
val javaVersion = JavaVersion.VERSION_17
111111
sourceCompatibility = javaVersion
112112
targetCompatibility = javaVersion
113113
}
114114

115115
sourceSets["main"].output.dir(mapOf("builtBy" to syncScriptsDirTask), scriptsDir)
116116

117117
node {
118-
version = "20.12.1"
118+
version = "22.14.0"
119119
download = true
120120
}
121121

gradle/wrapper/gradle-wrapper.jar

252 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
3+
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum
@@ -203,7 +205,7 @@ fi
203205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204206

205207
# Collect all arguments for the java command:
206-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207209
# and any embedded shellness will be escaped.
208210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209211
# treated as '${Hostname}' itself on the command line.

gradlew.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

settings.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("org.zaproxy.common.settings") version "0.3.0"
2+
id("org.zaproxy.common.settings") version "0.5.0"
33
id("com.diffplug.spotless") version "6.25.0" apply false
44
}
55

src/test/java/org/zaproxy/VerifyScripts.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private static Stream<Arguments> scriptsGroovy() {
104104

105105
private static Stream<Arguments> scriptsJavaScript() {
106106
// Graal JS version being used does not yet support Java 22+
107-
if (JRE.JAVA_22.compareTo(JRE.currentVersion()) <= 0) {
107+
if (JRE.JAVA_22.compareTo(JRE.currentJre()) <= 0) {
108108
return testData(".js", script -> {});
109109
}
110110
Engine engine =

0 commit comments

Comments
 (0)