Skip to content

Commit e99976b

Browse files
authored
chore: Maintenance for 3.1.1 (Fix CME, update wrapper, secure test deps, clean build script) (#409)
* Fix `ConcurrentModificationException`: Eagerly evaluates configurations to a static list (`.toList()`) in `CheckSnapshotDependencies.groovy`. This prevents crashes when using the plugin alongside frameworks (like Quarkus 3.25.1+) that dynamically mutate configurations during evaluation. (Fixes #406) * Build Script Modernization: * Removed legacy `buildscript` block and resolved plugin version conflicts. * Replaced deprecated `testCompile` with `testImplementation`. * Explicitly set `sourceCompatibility` and `targetCompatibility` to `1.8` to safeguard Java 8 baseline compatibility. * Update Test Dependencies: Bumped `guava` to `32.0.1-jre` to resolve known CVEs in the test harness. * Matrix & Runner Changes: * Expanded testing matrix to cover Gradle 6-9 across Java 8, 11, 17, and 21. * Configured CI to build always build the plugin with Java 8, while testing against the full matrix of Java versions via Gradle Toolchains. * Fixed artifact naming conflicts in the matrix to ensure consolidated JUnit reporting.
1 parent cedc768 commit e99976b

5 files changed

Lines changed: 38 additions & 31 deletions

File tree

.github/workflows/junit_report.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
- name: Download Test Report
1515
uses: dawidd6/action-download-artifact@v19
1616
with:
17-
name: junit-test-results
17+
name: junit-test-results-.*
18+
name_is_regexp: true
1819
workflow: ${{ github.event.workflow.id }}
1920
run_id: ${{ github.event.workflow_run.id }}
2021
- name: Publish Test Report

.github/workflows/tests.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,40 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
include:
16+
# Gradle 6
1617
- java-version: '8'
1718
gradle-version: '6.9.4'
19+
- java-version: '11'
20+
gradle-version: '6.9.4'
21+
22+
# Gradle 7
1823
- java-version: '8'
1924
gradle-version: '7.6.6'
20-
- java-version: '8'
25+
- java-version: '11'
26+
gradle-version: '7.6.6'
27+
28+
# Gradle 8
29+
- java-version: '11'
2130
gradle-version: '8.14.4'
2231
- java-version: '17'
32+
gradle-version: '8.14.4'
33+
34+
# Gradle 9 (Upcoming/Modern)
35+
- java-version: '17'
36+
gradle-version: '9.4.1'
37+
- java-version: '21'
2338
gradle-version: '9.4.1'
2439

2540
steps:
2641
- name: Checkout
2742
uses: actions/checkout@v6
2843

29-
- name: Set up JDK ${{ matrix.java-version }}
44+
- name: Set up JDKs
3045
uses: actions/setup-java@v5
3146
with:
32-
java-version: 8
47+
java-version: |
48+
${{ matrix.java-version }}
49+
8
3350
distribution: temurin
3451
architecture: x64
3552

@@ -49,6 +66,6 @@ jobs:
4966
uses: actions/upload-artifact@v7
5067
if: always() # always run even if the previous step fails
5168
with:
52-
name: junit-test-results-${{ matrix.gradle-version }}
69+
name: junit-test-results-${{ matrix.gradle-version }}-${{ matrix.java-version }}
5370
path: '**/build/test-results/test/TEST-*.xml'
5471
retention-days: 1

build.gradle

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11

2-
buildscript {
3-
repositories {
4-
maven {
5-
url "https://plugins.gradle.org/m2/"
6-
}
7-
}
8-
dependencies {
9-
classpath 'nu.studer:gradle-plugindev-plugin:4.1'
10-
classpath 'org.codehaus.groovy:groovy-backports-compat23:2.4.6'
11-
classpath 'net.researchgate:gradle-release:2.7.0'
12-
}
13-
}
14-
152
plugins {
16-
id 'org.gradle.java-gradle-plugin'
17-
id 'org.gradle.groovy'
3+
id 'java-gradle-plugin'
4+
id 'groovy'
185
id 'maven-publish'
19-
id 'net.researchgate.release' version '2.8.0'
6+
id 'idea'
7+
id 'net.researchgate.release' version '3.1.0'
208
id 'com.gradle.plugin-publish' version '0.18.0'
219
}
2210

23-
apply plugin: 'idea'
24-
2511
group='net.researchgate'
2612

13+
sourceCompatibility = 1.8
14+
targetCompatibility = 1.8
15+
2716
repositories {
2817
mavenCentral()
2918
}
@@ -32,10 +21,9 @@ dependencies {
3221
testImplementation("org.spockframework:spock-core:2.3-groovy-2.5") { exclude group: 'org.codehaus.groovy' }
3322
testImplementation "org.eclipse.jgit:org.eclipse.jgit:5.0.3.201809091024-r"
3423
testImplementation "cglib:cglib-nodep:3.2.8"
24+
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
3525
testImplementation gradleTestKit()
36-
testImplementation("org.junit.jupiter:junit-jupiter:5.7.1")
37-
38-
testRuntimeOnly('com.google.guava:guava:27.1-android')
26+
testRuntimeOnly('com.google.guava:guava:32.0.1-jre')
3927
}
4028

4129
gradlePlugin {
@@ -74,7 +62,7 @@ processResources.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
7462

7563
release {
7664
git {
77-
requireBranch = '(main|\\d+\\.\\d+)'
65+
requireBranch.set('(main|\\d+\\.\\d+)')
7866
}
7967
}
8068

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip
4-
distributionSha256Sum=3e240228538de9f18772a574e99a0ba959e83d6ef351014381acd9631781389a
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-all.zip
54
zipStoreBase=GRADLE_USER_HOME
65
zipStorePath=wrapper/dists
6+
distributionSha256Sum=84b50e7b380e9dc9bbc81e30a8eb45371527010cf670199596c86875f774b8b0
7+

src/main/groovy/net/researchgate/release/tasks/CheckSnapshotDependencies.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class CheckSnapshotDependencies extends BaseReleaseTask {
2222

2323
project.allprojects.each { project ->
2424
def snapshotDependencies = [] as Set
25-
project.configurations.each { cfg ->
25+
project.configurations.toList().each { cfg ->
2626
snapshotDependencies += cfg.dependencies?.matching(matcher)?.collect(collector)
2727
}
28-
project.buildscript.configurations.each { cfg ->
28+
project.buildscript.configurations.toList().each { cfg ->
2929
snapshotDependencies += cfg.dependencies?.matching(matcher)?.collect(collector)
3030
}
3131
if (snapshotDependencies.size() > 0) {

0 commit comments

Comments
 (0)