Skip to content

Commit b1553bc

Browse files
authored
Merge pull request #40 from rundeck-plugins/grails7-upgrade
Grails 7 Migration - Rundeck 6.0 Compatibility
2 parents 2b92761 + 7d041f4 commit b1553bc

File tree

9 files changed

+375
-188
lines changed

9 files changed

+375
-188
lines changed

.github/workflows/gradle.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,24 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414
- name: Get Fetch Tags
1515
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
1616
if: "!contains(github.ref, 'refs/tags')"
17-
- name: Set up JDK 1.8
18-
uses: actions/setup-java@v1
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
1919
with:
20-
java-version: 11
20+
java-version: '17'
21+
distribution: 'zulu'
2122
- name: Grant execute permission for gradlew
2223
run: chmod +x gradlew
2324
- name: Build with Gradle
2425
run: ./gradlew build
2526
- name: Get Release Version
2627
id: get_version
27-
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
28+
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
2829
- name: Upload plugin jar
2930
uses: actions/upload-artifact@v4
3031
with:

.github/workflows/release.yml

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
11
on:
22
push:
3-
# Sequence of patterns matched against refs/tags
43
tags:
5-
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
4+
- '*.*.*'
65

7-
name: Upload Release Asset
6+
name: Publish Release
87

98
jobs:
109
build:
11-
name: Upload Release Asset
10+
name: Publish Release
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: Checkout code
15-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1615
with:
1716
fetch-depth: 0
18-
- name: set up JDK 1.8
19-
uses: actions/setup-java@v1
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
2019
with:
21-
java-version: 11
20+
java-version: '17'
21+
distribution: 'zulu'
2222
- name: Build with Gradle
2323
run: ./gradlew build
2424
- name: Get Release Version
2525
id: get_version
26-
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
26+
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
2727
- name: Create Release
28-
id: create_release
29-
uses: actions/create-release@v1.0.0
28+
run: |
29+
gh release create \
30+
--generate-notes \
31+
--title 'Release ${{ steps.get_version.outputs.VERSION }}' \
32+
${{ github.ref_name }} \
33+
build/libs/http-step-${{ steps.get_version.outputs.VERSION }}.jar
3034
env:
3135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
with:
33-
tag_name: ${{ github.ref }}
34-
release_name: Release ${{ steps.get_version.outputs.VERSION }}
35-
draft: false
36-
prerelease: false
37-
- name: Upload Release Asset (jar)
38-
id: upload-release-asset
39-
uses: actions/upload-release-asset@v1
36+
- name: Publish to Maven Central
37+
run: ./gradlew -PsigningKey=${SIGNING_KEY_B64} -PsigningPassword=${SIGNING_PASSWORD} -PsonatypeUsername=${SONATYPE_USERNAME} -PsonatypePassword=${SONATYPE_PASSWORD} publishToSonatype closeAndReleaseSonatypeStagingRepository
4038
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
with:
43-
upload_url: ${{ steps.create_release.outputs.upload_url }}
44-
asset_path: build/libs/http-step-${{ steps.get_version.outputs.VERSION }}.jar
45-
asset_name: http-step-${{ steps.get_version.outputs.VERSION }}.jar
46-
asset_content_type: application/octet-stream
39+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
40+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
41+
SIGNING_KEY_B64: ${{ secrets.SIGNING_KEY_B64 }}
42+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

build.gradle

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,55 @@
11
plugins {
22
id 'pl.allegro.tech.build.axion-release' version '1.17.2'
33
id 'java'
4-
id 'maven-publish'
4+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
55
}
66

7-
apply plugin: 'java'
8-
9-
sourceCompatibility = 1.11
7+
java {
8+
sourceCompatibility = JavaVersion.VERSION_17
9+
targetCompatibility = JavaVersion.VERSION_17
10+
withSourcesJar()
11+
withJavadocJar()
12+
}
1013
ext.rundeckPluginVersion = '1.2'
1114
ext.pluginClassNames='edu.ohio.ais.rundeck.HttpWorkflowStepPlugin,edu.ohio.ais.rundeck.HttpWorkflowNodeStepPlugin'
1215
ext.pluginName = 'Rundeck Http Step'
1316
ext.pluginDescription = 'A workflow plugin that makes HTTP requests'
14-
group = 'com.github.rundeck-plugins'
17+
group = 'org.rundeck.plugins'
18+
19+
ext.publishName = "Rundeck Http Step ${project.version}"
20+
ext.githubSlug = 'rundeck-plugins/http-step'
21+
ext.developers = [
22+
[id: 'gschueler', name: 'Greg Schueler', email: 'greg@rundeck.com']
23+
]
1524

1625
scmVersion {
17-
ignoreUncommittedChanges = true
26+
ignoreUncommittedChanges = false
1827
tag {
19-
prefix = ''
28+
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
2029
versionSeparator = ''
2130
}
2231
}
23-
project.version = scmVersion.version
2432

33+
version = scmVersion.version // Dynamic version from git tag
2534

2635
repositories {
2736
mavenLocal()
37+
maven {
38+
name = 'Central Portal Snapshots'
39+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
40+
content {
41+
includeGroup('org.rundeck')
42+
}
43+
}
44+
maven {
45+
name = 'Central Portal Snapshots'
46+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
47+
48+
// Only search this repository for org.rundeck snapshots
49+
content {
50+
includeGroup('org.rundeck')
51+
}
52+
}
2853
mavenCentral()
2954
}
3055

@@ -39,16 +64,18 @@ configurations{
3964
}
4065

4166
dependencies {
42-
implementation 'org.rundeck:rundeck-core:5.14.0-rc1-20250722'
67+
compileOnly 'org.rundeck:rundeck-core:6.0.0-alpha1-20260407'
68+
testImplementation 'org.rundeck:rundeck-core:6.0.0-alpha1-20260407'
4369

4470
// Add secure commons-lang3 to provide alternative to vulnerable commons-lang 2.6
45-
implementation 'org.apache.commons:commons-lang3:3.18.0'
71+
// Version 3.20.0 fixes CVE-2025-48924 (StackOverflowError in ClassUtils)
72+
pluginLibs 'org.apache.commons:commons-lang3:3.20.0'
4673

4774
pluginLibs group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
4875
pluginLibs group: 'com.google.code.gson', name: 'gson', version:'2.10.1'
4976

5077
testImplementation group: 'com.github.tomakehurst', name: 'wiremock-standalone', version:'2.23.2'
51-
testImplementation group: 'junit', name: 'junit', version:'4.13.1'
78+
testImplementation group: 'junit', name: 'junit', version:'4.13.2'
5279

5380
testImplementation (
5481
'org.mockito:mockito-all:1.9.5',
@@ -60,22 +87,32 @@ dependencies {
6087
configurations.all {
6188
resolutionStrategy {
6289
// Replace vulnerable commons-lang with secure commons-lang3
90+
// Version 3.18.0 fixes CVE-2025-48924 (StackOverflowError in ClassUtils)
6391
dependencySubstitution {
6492
substitute module('commons-lang:commons-lang') using module('org.apache.commons:commons-lang3:3.18.0')
6593
}
6694
}
6795
}
6896

6997

70-
// task to copy plugin libs to output/lib dir
71-
task copyToLib(type: Copy) {
72-
into "$buildDir/output/lib"
73-
from configurations.pluginLibs
98+
test {
99+
useJUnit()
100+
101+
// Java 17+ module access for reflection/mocking
102+
jvmArgs = [
103+
'--add-opens=java.base/java.lang=ALL-UNNAMED',
104+
'--add-opens=java.base/java.util=ALL-UNNAMED',
105+
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED',
106+
'--add-opens=java.base/java.net=ALL-UNNAMED'
107+
]
74108
}
75109

76-
77110
jar {
78-
from "$buildDir/output"
111+
// Include plugin dependencies in lib/ directory
112+
into('lib') {
113+
from configurations.pluginLibs
114+
}
115+
79116
manifest {
80117
def libList = configurations.pluginLibs.collect{'lib/'+it.name}.join(' ')
81118

@@ -86,22 +123,22 @@ jar {
86123
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '3.x'
87124
attributes 'Rundeck-Plugin-Tags': 'java,WorkflowStep'
88125
attributes 'Rundeck-Plugin-License': 'Apache 2.0'
89-
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/http-notification'
126+
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/http-step'
90127
attributes 'Rundeck-Plugin-Target-Host-Compatibility': 'all'
91128
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion
92129
attributes 'Rundeck-Plugin-Archive': 'true'
93130
attributes 'Rundeck-Plugin-Libs': "${libList}"
94-
95131
}
96-
dependsOn(copyToLib)
97-
98132
}
99133

100-
publishing {
101-
publications {
102-
maven(MavenPublication) {
103-
artifactId = 'http-step'
104-
from components.java
134+
nexusPublishing {
135+
packageGroup = 'org.rundeck.plugins'
136+
repositories {
137+
sonatype {
138+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
139+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
105140
}
106141
}
107-
}
142+
}
143+
144+
apply from: "${rootDir}/gradle/publishing.gradle"

gradle/publishing.gradle

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/**
2+
* Define project extension values in the project gradle file before including this file:
3+
*
4+
* publishName = 'Name of Package'
5+
* publishDescription = 'description' (optional)
6+
* githubSlug = Github slug e.g. 'rundeck/rundeck-cli'
7+
* developers = [ [id:'id', name:'name', email: 'email' ] ] list of developers
8+
*
9+
* Define project properties to sign and publish when invoking publish task:
10+
*
11+
* ./gradlew \
12+
* -PsigningKey="base64 encoded gpg key" \
13+
* -PsigningPassword="password for key" \
14+
* -PsonatypeUsername="sonatype token user" \
15+
* -PsonatypePassword="sonatype token password" \
16+
* publishToSonatype closeAndReleaseSonatypeStagingRepository
17+
*/
18+
apply plugin: 'maven-publish'
19+
apply plugin: 'signing'
20+
21+
publishing {
22+
publications {
23+
"${project.name}"(MavenPublication) { publication ->
24+
from components.java
25+
26+
pom {
27+
name = publishName
28+
description = project.ext.hasProperty('publishDescription') ? project.ext.publishDescription :
29+
project.description ?: publishName
30+
url = "https://github.com/${githubSlug}"
31+
licenses {
32+
license {
33+
name = 'The Apache Software License, Version 2.0'
34+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
35+
distribution = 'repo'
36+
}
37+
}
38+
scm {
39+
url = "https://github.com/${githubSlug}"
40+
connection = "scm:git:git@github.com/${githubSlug}.git"
41+
developerConnection = "scm:git:git@github.com:${githubSlug}.git"
42+
}
43+
if (project.ext.developers) {
44+
developers {
45+
project.ext.developers.each { dev ->
46+
developer {
47+
id = dev.id
48+
name = dev.name
49+
email = dev.email
50+
}
51+
}
52+
}
53+
}
54+
}
55+
56+
}
57+
}
58+
repositories {
59+
def pkgcldWriteToken = System.getenv("PKGCLD_WRITE_TOKEN") ?: project.findProperty("pkgcldWriteToken")
60+
if (pkgcldWriteToken) {
61+
maven {
62+
name = "PackageCloudTest"
63+
url = uri("https://packagecloud.io/pagerduty/rundeckpro-test/maven2")
64+
authentication {
65+
header(HttpHeaderAuthentication)
66+
}
67+
credentials(HttpHeaderCredentials) {
68+
name = "Authorization"
69+
value = "Bearer " + pkgcldWriteToken
70+
}
71+
}
72+
}
73+
}
74+
}
75+
def base64Decode = { String prop ->
76+
project.findProperty(prop) ?
77+
new String(Base64.getDecoder().decode(project.findProperty(prop).toString())).trim() :
78+
null
79+
}
80+
81+
if (project.hasProperty('signingKey') && project.hasProperty('signingPassword')) {
82+
signing {
83+
useInMemoryPgpKeys(base64Decode("signingKey"), project.signingPassword)
84+
sign(publishing.publications)
85+
}
86+
}

gradle/wrapper/gradle-wrapper.jar

5.28 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)