Skip to content

Commit 250a59a

Browse files
marko-bekhtasebersole
authored andcommitted
HHH-18528 JDK 23 strict JAXP testing
1 parent f25c70a commit 250a59a

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

nightly.Jenkinsfile

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,49 @@ stage('Build') {
222222
def repo2 = tempDir + '/repo2'
223223
// build Hibernate ORM two times without any cache and "publish" the resulting artifacts to different maven repositories
224224
// so that we can compare them afterwards:
225-
sh "./gradlew --no-daemon clean publishToMavenLocal --no-build-cache -Dmaven.repo.local=$repo1"
226-
sh "./gradlew --no-daemon clean publishToMavenLocal --no-build-cache -Dmaven.repo.local=$repo2"
225+
sh "./gradlew --no-daemon clean publishToMavenLocal --no-build-cache -Dmaven.repo.local=${repo1}"
226+
sh "./gradlew --no-daemon clean publishToMavenLocal --no-build-cache -Dmaven.repo.local=${repo2}"
227227

228-
sh "sh ci/compare-build-results.sh $repo1 $repo2"
228+
sh "sh ci/compare-build-results.sh ${repo1} ${repo2}"
229229
sh "cat .buildcompare"
230230
}
231231
}
232232
}
233233
}
234234
})
235+
executions.put('Strict JAXP configuration', {
236+
runBuildOnNode(NODE_PATTERN_BASE) {
237+
// we want to test with JDK 23 where the strict settings were introduced
238+
def testJavaHome = tool(name: "OpenJDK 23 Latest", type: 'jdk')
239+
def javaHome = tool(name: DEFAULT_JDK_TOOL, type: 'jdk')
240+
// Use withEnv instead of setting env directly, as that is global!
241+
// See https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md
242+
withEnv(["JAVA_HOME=${javaHome}", "PATH+JAVA=${javaHome}/bin"]) {
243+
stage('Checkout') {
244+
checkout scm
245+
}
246+
stage('Test') {
247+
withGradle {
248+
def tempDir = pwd(tmp: true)
249+
def jaxpStrictProperties = tempDir + '/jaxp-strict.properties'
250+
def jaxpStrictTemplate = testJavaHome + '/conf/jaxp-strict.properties.template'
251+
252+
echo 'Copy strict JAXP configuration properties.'
253+
sh "cp $jaxpStrictTemplate $jaxpStrictProperties"
254+
255+
// explicitly calling toString here to prevent Jenkins failures like:
256+
// > Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (org.codehaus.groovy.runtime.GStringImpl positive)
257+
String args = ("-Ptest.jdk.version=23 -Porg.gradle.java.installations.paths=${javaHome},${testJavaHome}"
258+
+ " -Ptest.jdk.launcher.args=\"-Djava.xml.config.file=${jaxpStrictProperties}\"").toString()
259+
260+
timeout( [time: 60, unit: 'MINUTES'] ) {
261+
ciBuild(args)
262+
}
263+
}
264+
}
265+
}
266+
}
267+
})
235268
}
236269
parallel(executions)
237270
}
@@ -273,6 +306,14 @@ void ciBuild(buildEnv, String args) {
273306
// it has limited access, essentially it can only push build scans.
274307
def develocityCredentialsId = buildEnv.node ? 'ge.hibernate.org-access-key-pr' : 'ge.hibernate.org-access-key'
275308

309+
ciBuild(develocityCredentialsId, args)
310+
}
311+
312+
void ciBuild(String args) {
313+
ciBuild('ge.hibernate.org-access-key-pr', args)
314+
}
315+
316+
void ciBuild(String develocityCredentialsId, String args) {
276317
withCredentials([string(credentialsId: develocityCredentialsId,
277318
variable: 'DEVELOCITY_ACCESS_KEY')]) {
278319
withGradle { // withDevelocity, actually: https://plugins.jenkins.io/gradle/#plugin-content-capturing-build-scans-from-jenkins-pipeline

0 commit comments

Comments
 (0)