1+ import groovy.transform.Field
2+
13@Library('hibernate-jenkins-pipeline-helpers') _
24
5+ @Field final String DEFAULT_JDK_VERSION = '21'
6+ @Field final String DEFAULT_JDK_TOOL = "OpenJDK ${DEFAULT_JDK_VERSION} Latest"
7+
38// Avoid running the pipeline on branch indexing
49if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
510 print "INFO: Build skipped due to trigger being Branch Indexing"
@@ -61,20 +66,20 @@ class BuildConfiguration {
6166
6267// See data category from https://github.com/quarkusio/quarkus/blob/main/.github/native-tests.json
6368def configurations = [
64- new BuildConfiguration( name: "JVM test", projects: "!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/hibernate-search-orm-elasticsearch-outbox-polling,!integration-tests/hibernate-search-orm-elasticsearch-tenancy,!integration-tests/maven,!integration-tests/quartz,!integration-tests/reactive-messaging-kafka,!integration-tests/resteasy-reactive-kotlin/standard,!integration-tests/opentelemetry-reactive-messaging,!integration-tests/virtual-threads/kafka-virtual-threads,!integration-tests/smallrye-jwt-oidc-webapp,!extensions/oidc-db-token-state-manager/deployment,!docs",
65- new BuildConfiguration( name: "Data1", nativeProfile: true, projects: "jpa-h2, jpa-h2-embedded, jpa-mariadb, jpa-mssql, jpa-without-entity, hibernate-orm-tenancy/datasource, hibernate-orm-tenancy/connection-resolver, hibernate-orm-tenancy/connection-resolver-legacy-qualifiers",
66- new BuildConfiguration( name: "Data2", nativeProfile: true, projects: "jpa, jpa-mapping-xml/legacy-app, jpa-mapping-xml/modern-app, jpa-mysql, jpa-db2, jpa-oracle",
67- new BuildConfiguration( name: "Data3", nativeProfile: true, projects: "flyway, hibernate-orm-panache, hibernate-orm-panache-kotlin, hibernate-orm-envers, liquibase, liquibase-mongodb",
68- new BuildConfiguration( name: "Data4", nativeProfile: true, projects: "mongodb-client, mongodb-devservices, mongodb-panache, mongodb-rest-data-panache, mongodb-panache-kotlin, redis-client, hibernate-orm-rest-data-panache",
69- new BuildConfiguration( name: "Data5", nativeProfile: true, projects: "jpa-postgresql, jpa-postgresql-withxml, narayana-stm, narayana-jta, reactive-pg-client, hibernate-reactive-postgresql, hibernate-orm-tenancy/schema, hibernate-orm-tenancy/schema-mariadb",
70- new BuildConfiguration( name: "Data6", nativeProfile: true, projects: "elasticsearch-rest-client, elasticsearch-java-client, hibernate-search-orm-elasticsearch, hibernate-search-orm-elasticsearch-tenancy, hibernate-search-orm-opensearch, hibernate-search-orm-elasticsearch-outbox-polling, hibernate-search-standalone-elasticsearch, hibernate-search-standalone-opensearch",
71- new BuildConfiguration( name: "Data7", nativeProfile: true, projects: "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mariadb, hibernate-reactive-mssql, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal-flyway, hibernate-reactive-panache, hibernate-reactive-panache-kotlin, hibernate-reactive-oracle"
69+ new BuildConfiguration( name: "JVM test", projects: "!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/hibernate-search-orm-elasticsearch-outbox-polling,!integration-tests/hibernate-search-orm-elasticsearch-tenancy,!integration-tests/maven,!integration-tests/quartz,!integration-tests/reactive-messaging-kafka,!integration-tests/resteasy-reactive-kotlin/standard,!integration-tests/opentelemetry-reactive-messaging,!integration-tests/virtual-threads/kafka-virtual-threads,!integration-tests/smallrye-jwt-oidc-webapp,!extensions/oidc-db-token-state-manager/deployment,!docs") ,
70+ new BuildConfiguration( name: "Data1", nativeProfile: true, projects: "jpa-h2, jpa-h2-embedded, jpa-mariadb, jpa-mssql, jpa-without-entity, hibernate-orm-tenancy/datasource, hibernate-orm-tenancy/connection-resolver, hibernate-orm-tenancy/connection-resolver-legacy-qualifiers") ,
71+ new BuildConfiguration( name: "Data2", nativeProfile: true, projects: "jpa, jpa-mapping-xml/legacy-app, jpa-mapping-xml/modern-app, jpa-mysql, jpa-db2, jpa-oracle") ,
72+ new BuildConfiguration( name: "Data3", nativeProfile: true, projects: "flyway, hibernate-orm-panache, hibernate-orm-panache-kotlin, hibernate-orm-envers, liquibase, liquibase-mongodb") ,
73+ new BuildConfiguration( name: "Data4", nativeProfile: true, projects: "mongodb-client, mongodb-devservices, mongodb-panache, mongodb-rest-data-panache, mongodb-panache-kotlin, redis-client, hibernate-orm-rest-data-panache") ,
74+ new BuildConfiguration( name: "Data5", nativeProfile: true, projects: "jpa-postgresql, jpa-postgresql-withxml, narayana-stm, narayana-jta, reactive-pg-client, hibernate-reactive-postgresql, hibernate-orm-tenancy/schema, hibernate-orm-tenancy/schema-mariadb") ,
75+ new BuildConfiguration( name: "Data6", nativeProfile: true, projects: "elasticsearch-rest-client, elasticsearch-java-client, hibernate-search-orm-elasticsearch, hibernate-search-orm-elasticsearch-tenancy, hibernate-search-orm-opensearch, hibernate-search-orm-elasticsearch-outbox-polling, hibernate-search-standalone-elasticsearch, hibernate-search-standalone-opensearch") ,
76+ new BuildConfiguration( name: "Data7", nativeProfile: true, projects: "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mariadb, hibernate-reactive-mssql, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal-flyway, hibernate-reactive-panache, hibernate-reactive-panache-kotlin, hibernate-reactive-oracle")
7277]
7378
7479pipeline {
7580 agent none
7681 tools {
77- jdk 'OpenJDK 21 Latest'
82+ jdk DEFAULT_JDK_TOOL
7883 maven 'Apache Maven 3.9'
7984 }
8085 options {
@@ -88,34 +93,38 @@ pipeline {
8893 requireApprovalForPullRequest 'hibernate'
8994 }
9095 }
91- stage('Build') {
96+ stage('Build Hibernate ORM') {
97+ agent {
98+ label 'LongDuration'
99+ }
92100 steps {
93- stage('Build Hibernate ORM') {
94- agent {
95- label 'LongDuration'
96- }
97- script {
98- dir('hibernate') {
99- checkout scm
100- sh "./gradlew clean publishToMavenLocal -x test --no-scan --no-daemon --no-build-cache --stacktrace -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -Dmaven.repo.local=${env.WORKSPACE}/.m2repository"
101- script {
102- env.HIBERNATE_VERSION = sh (
103- script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
104- returnStdout: true
105- ).trim()
106- }
101+ script {
102+ dir('hibernate') {
103+ checkout scm
104+ sh "./gradlew clean publishToMavenLocal -x test --no-scan --no-daemon --no-build-cache --stacktrace -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -Dmaven.repo.local=${env.WORKSPACE}/.m2repository"
105+ script {
106+ env.HIBERNATE_VERSION = sh (
107+ script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
108+ returnStdout: true
109+ ).trim()
107110 }
108111 }
112+ stash name: 'repository', includes: ".m2repository/"
109113 }
110- stage('Build Quarkus') {
111- agent {
112- label 'LongDuration'
113- }
114- script {
115- Map<String, Closure> executions = [:]
114+ }
115+ }
116+ stage('Build Quarkus') {
117+ agent {
118+ label 'LongDuration'
119+ }
120+ steps {
121+ script {
122+ Map<String, Closure> executions = [:]
116123
117- configurations.each { BuildConfiguration configuration ->
118- executions.put(configuration.name, {
124+ configurations.each { BuildConfiguration configuration ->
125+ executions.put(configuration.name, {
126+ node( 'LongDuration' ) {
127+ unstash "repository"
119128 dir('quarkus') {
120129 def quarkusVersionToTest = 'orm-7-1-10-3.27'
121130 sh "git clone -b ${quarkusVersionToTest} --single-branch https://github.com/yrodiere/quarkus.git . || git reset --hard && git clean -fx && git pull"
@@ -129,9 +138,10 @@ pipeline {
129138 sh "sed -i 's/-Xmx5g/-Xmx2048m/' ./.mvn/jvm.config"
130139 sh "echo -e '\\n-XX:MaxMetaspaceSize=1024m'>>./.mvn/jvm.config"
131140 withMaven(mavenLocalRepo: env.WORKSPACE + '/.m2repository', publisherStrategy: 'EXPLICIT') {
141+ def javaHome = tool(name: DEFAULT_JDK_TOOL, type: 'jdk')
132142 // to account for script-only maven wrapper use in Quarkus:
133- withEnv(["MAVEN_ARGS=${env.MAVEN_ARGS?:""} ${env.MAVEN_CONFIG}"]) {
134- sh "./mvnw -pl !docs -Dquickly install"
143+ withEnv(["JAVA_HOME=${javaHome}", "PATH+JAVA=${javaHome}/bin", " MAVEN_ARGS=${env.MAVEN_ARGS?:""} ${env.MAVEN_CONFIG}"]) {
144+ sh "./mvnw -pl !docs -Dquickly -Dskip.gradle.build install"
135145 // Need to kill the gradle daemons started during the Maven install run
136146 sh "sudo pkill -f '.*GradleDaemon.*' || true"
137147 // Need to override the default maven configuration this way, because there is no other way to do it
@@ -152,10 +162,10 @@ pipeline {
152162 }
153163 }
154164 }
155- })
156- }
157- parallel executions
165+ }
166+ })
158167 }
168+ parallel executions
159169 }
160170 }
161171 }
0 commit comments