Skip to content

Commit

Permalink
HSEARCH-5155 Build with JDK 21
Browse files Browse the repository at this point in the history
Meaning use JDK 21 for building main artifacts; the baseline (JDK 11) will not change.
  • Loading branch information
yrodiere committed Jul 1, 2024
1 parent 70423c8 commit 0c6cfec
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ jobs:
matrix:
os:
- {
name: "Linux JDK 17",
name: "Linux JDK 21",
runs-on: 'ubuntu-latest',
java: {
version: 17
version: 21
},
maven: {
# Since we only start an Elasticsearch container on Linux we add the profile to enable container reuse here:
Expand All @@ -77,10 +77,10 @@ jobs:
# so we can't run Elasticsearch tests.
# See https://github.com/actions/runner-images/issues/1143#issuecomment-972929995
- {
name: "Windows JDK 17",
name: "Windows JDK 21",
runs-on: 'windows-latest',
java: {
version: 17
version: 21
},
maven: {
args: '-Dtest.elasticsearch.skip=true'
Expand Down
7 changes: 3 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ import org.hibernate.jenkins.pipeline.helpers.alternative.AlternativeMultiMap
* settingsId: ...
*/

@Field final String DEFAULT_JDK_TOOL = 'OpenJDK 17 Latest'
@Field final String DEFAULT_JDK_TOOL = 'OpenJDK 21 Latest'
@Field final String MAVEN_TOOL = 'Apache Maven 3.9'

// Default node pattern, to be used for resource-intensive stages.
Expand Down Expand Up @@ -189,14 +189,13 @@ stage('Configure') {
new JdkBuildEnvironment(version: '11', testCompilerTool: 'OpenJDK 11 Latest',
condition: TestCondition.AFTER_MERGE),
new JdkBuildEnvironment(version: '17', testCompilerTool: 'OpenJDK 17 Latest',
condition: TestCondition.AFTER_MERGE),
new JdkBuildEnvironment(version: '21', testCompilerTool: 'OpenJDK 21 Latest',
condition: TestCondition.BEFORE_MERGE,
isDefault: true),
// We want to enable preview features when testing newer builds of OpenJDK:
// even if we don't use these features, just enabling them can cause side effects
// and it's useful to test that.
new JdkBuildEnvironment(version: '21', testCompilerTool: 'OpenJDK 21 Latest',
testLauncherArgs: '--enable-preview',
condition: TestCondition.AFTER_MERGE),
new JdkBuildEnvironment(version: '22', testCompilerTool: 'OpenJDK 22 Latest',
testLauncherArgs: '--enable-preview',
condition: TestCondition.AFTER_MERGE),
Expand Down
3 changes: 1 addition & 2 deletions ci/dependency-update/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Map settings() {
]
case 'lucene10':
return [
testCompilerTool: 'OpenJDK 21 Latest',
updateProperties: ['version.org.apache.lucene'],
onlyRunTestDependingOn: ['hibernate-search-backend-lucene'],
additionalMavenArgs: '-Dtest.elasticsearch.skip=true -pl :hibernate-search-engine,:hibernate-search-backend-lucene,:hibernate-search-util-internal-integrationtest-backend-lucene,:hibernate-search-v5migrationhelper-engine'
Expand Down Expand Up @@ -76,7 +75,7 @@ def pullContainerImages() {
}

def withMavenWorkspace(Closure body) {
def actualJdk = settings().testCompilerTool == null ? 'OpenJDK 17 Latest' : settings().testCompilerTool
def actualJdk = settings().testCompilerTool == null ? 'OpenJDK 21 Latest' : settings().testCompilerTool
withMaven(jdk: actualJdk, maven: 'Apache Maven 3.9',
mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository',
options: [
Expand Down
2 changes: 1 addition & 1 deletion ci/performance/elasticsearch/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import groovy.transform.Field
import org.hibernate.jenkins.pipeline.helpers.job.JobHelper

@Field final String MAVEN_TOOL = 'Apache Maven 3.9'
@Field final String JDK_TOOL = 'OpenJDK 11 Latest'
@Field final String JDK_TOOL = 'OpenJDK 21 Latest'

// Performance node pattern, to be used for stages involving performance tests.
@Field final String PERFORMANCE_NODE_PATTERN = 'Performance'
Expand Down
2 changes: 1 addition & 1 deletion ci/performance/lucene/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import groovy.transform.Field
import org.hibernate.jenkins.pipeline.helpers.job.JobHelper

@Field final String MAVEN_TOOL = 'Apache Maven 3.9'
@Field final String JDK_TOOL = 'OpenJDK 11 Latest'
@Field final String JDK_TOOL = 'OpenJDK 21 Latest'

// Performance node pattern, to be used for stages involving performance tests.
@Field final String PERFORMANCE_NODE_PATTERN = 'Performance'
Expand Down
2 changes: 1 addition & 1 deletion ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pipeline {
}
tools {
maven 'Apache Maven 3.9'
jdk 'OpenJDK 17 Latest'
jdk 'OpenJDK 21 Latest'
}
options {
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')
Expand Down
8 changes: 0 additions & 8 deletions integrationtest/performance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
<name>Hibernate Search ITs - Performance - Parent POM</name>
<description>Parent POM of Hibernate Search performance tests</description>

<properties>
<!-- JMH or the annotation processor plugin has some trouble with newer JDKs.
Let's not bother, and use the same JDK as Maven, unlike other integration tests. -->
<java-version.main.release>8</java-version.main.release>
<java-version.main.compiler.java_home>${java.home}</java-version.main.compiler.java_home>
<java-version.main.compiler>${java-version.main.compiler.java_home}/bin/javac</java-version.main.compiler>
</properties>

<modules>
<module>backend/base</module>
<module>backend/lucene</module>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- JDK version required for the build; we target 11 but require at least 17 for the build -->
<jdk.min.version>17</jdk.min.version>
<jdk.min.version>21</jdk.min.version>
<!-- The lowest supported version of Java for applications using Hibernate Search -->
<!-- Set statically, independently from the current JDK: we want our code to comply with this version -->
<java-version.main.release>11</java-version.main.release>
Expand Down

0 comments on commit 0c6cfec

Please sign in to comment.