Skip to content

Commit bed39fb

Browse files
committed
HHH-19894 - Use Java 25 for building
HHH-19830 - Use of markdown for Javadoc + Switch the Javadoc theme for JDK 25
1 parent 87c9417 commit bed39fb

File tree

21 files changed

+383
-432
lines changed

21 files changed

+383
-432
lines changed

.github/workflows/ci-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2626
with:
2727
distribution: 'temurin'
28-
java-version: '21'
28+
java-version: '25'
2929

3030
- name: Generate cache key
3131
id: cache-key

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
build:
3434
permissions:
3535
contents: read
36-
name: OpenJDK 21 - ${{matrix.rdbms}}
36+
name: OpenJDK 25 - ${{matrix.rdbms}}
3737
runs-on: ubuntu-latest
3838
strategy:
3939
fail-fast: false
@@ -63,11 +63,11 @@ jobs:
6363
env:
6464
RDBMS: ${{ matrix.rdbms }}
6565
run: ci/database-start.sh
66-
- name: Set up Java 21
66+
- name: Set up Java 25
6767
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
6868
with:
6969
distribution: 'temurin'
70-
java-version: '21'
70+
java-version: '25'
7171

7272
- name: Generate cache key
7373
id: cache-key
@@ -147,7 +147,7 @@ jobs:
147147
otp:
148148
permissions:
149149
contents: read
150-
name: GraalVM 21 - ${{matrix.rdbms}}
150+
name: GraalVM 25 - ${{matrix.rdbms}}
151151
runs-on: [ self-hosted, Linux, X64, OracleTestPilot ]
152152
strategy:
153153
fail-fast: false
@@ -161,11 +161,11 @@ jobs:
161161
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
162162
with:
163163
persist-credentials: false
164-
- name: Set up Java 21
164+
- name: Set up Java 25
165165
uses: graalvm/setup-graalvm@aafbedb8d382ed0ca6167d3a051415f20c859274 # v1.2.8
166166
with:
167167
distribution: 'graalvm'
168-
java-version: '21'
168+
java-version: '25'
169169
- name: Generate cache key
170170
id: cache-key
171171
run: |
@@ -270,11 +270,11 @@ jobs:
270270
persist-credentials: false
271271
- name: Reclaim disk space and sanitize user home
272272
run: .github/ci-prerequisites-atlas.sh
273-
- name: Set up Java 21
273+
- name: Set up Java 25
274274
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
275275
with:
276276
distribution: 'temurin'
277-
java-version: '21'
277+
java-version: '25'
278278

279279
- name: Generate cache key
280280
id: cache-key

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
4141
with:
4242
distribution: 'temurin'
43-
java-version: '21'
43+
java-version: '25'
4444

4545
- name: Checkout repository
4646
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Jenkinsfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper
1414
@Library('hibernate-jenkins-pipeline-helpers') _
1515
import org.hibernate.jenkins.pipeline.helpers.job.JobHelper
1616

17-
@Field final String DEFAULT_JDK_VERSION = '21'
17+
@Field final String DEFAULT_JDK_VERSION = '25'
1818
@Field final String DEFAULT_JDK_TOOL = "OpenJDK ${DEFAULT_JDK_VERSION} Latest"
1919
@Field final String NODE_PATTERN_BASE = 'Worker&&Containers'
2020
@Field List<BuildEnvironment> environments
@@ -40,13 +40,14 @@ stage('Configure') {
4040
// Don't build with HANA by default, but only do it nightly until we receive a 3rd instance
4141
// new BuildEnvironment( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ),
4242
new BuildEnvironment( node: 's390x' ),
43-
// We generally build with JDK 21, but our baseline is Java 17, so we test with JDK 17, to be sure everything works.
44-
// Here we even compile the main code with JDK 17, to be sure no JDK 18+ classes are depended on.
45-
new BuildEnvironment( mainJdkVersion: '17', testJdkVersion: '17' ),
43+
// We generally build with JDK 25, but our baseline is Java 17, so we test with JDK 17, to be sure everything works.
44+
new BuildEnvironment( mainJdkVersion: '25', testJdkVersion: '17' ),
45+
// Additionally, have one job that builds using JDK 17 as well
46+
new BuildEnvironment( mainJdkVersion: '17', additionalOptions: '-Porm.jdk.min=17' ),
47+
new BuildEnvironment( mainJdkVersion: '25', testJdkVersion: '21' ),
4648
// We want to enable preview features when testing newer builds of OpenJDK:
4749
// even if we don't use these features, just enabling them can cause side effects
4850
// and it's useful to test that.
49-
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
5051
new BuildEnvironment( testJdkVersion: '25', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
5152
// The following JDKs aren't supported by Hibernate ORM out-of-the box yet:
5253
// they require the use of -Dnet.bytebuddy.experimental=true.
@@ -170,7 +171,7 @@ stage('Build') {
170171
}
171172
stage('Test') {
172173
String args = "${buildEnv.additionalOptions ?: ''} ${state[buildEnv.tag]['additionalOptions'] ?: ''}"
173-
withEnv(["RDBMS=${buildEnv.dbName}"]) {
174+
withEnv(["RDBMS=${buildEnv.dbName}", 'CI_SYSTEM=jenkins']) {
174175
tryFinally({
175176
if (buildEnv.dbLockableResource == null) {
176177
withCredentials([file(credentialsId: 'sybase-jconnect-driver', variable: 'jconnect_driver')]) {

ci/build.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
goal=
44
if [ "$RDBMS" == "h2" ] || [ "$RDBMS" == "" ]; then
55
# This is the default.
6-
goal="preVerifyRelease"
7-
# Settings needed for `preVerifyRelease` execution - for asciidoctor doc rendering
8-
export GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'
6+
# - special check for Jenkins CI jobs where we don't want to run preVerifyRelease
7+
if [[ -n "$CI_SYSTEM" && "$CI_SYSTEM" != "jenkins" ]]; then
8+
goal="preVerifyRelease"
9+
# Settings needed for `preVerifyRelease` execution - for asciidoctor doc rendering
10+
export GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'
11+
fi
912
elif [ "$RDBMS" == "hsqldb" ] || [ "$RDBMS" == "hsqldb_2_6" ]; then
1013
goal="-Pdb=hsqldb"
1114
elif [ "$RDBMS" == "mysql" ] || [ "$RDBMS" == "mysql_8_0" ]; then

ci/jpa-3.2-tck.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ else {
2222
pipeline {
2323
agent none
2424
tools {
25-
jdk 'OpenJDK 21 Latest'
25+
jdk 'OpenJDK 25 Latest'
2626
}
2727
options {
2828
rateLimitBuilds(throttle: [count: throttleCount, durationName: 'day', userBoost: true])
2929
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
3030
disableConcurrentBuilds(abortPrevious: true)
3131
}
3232
parameters {
33-
choice(name: 'IMAGE_JDK', choices: ['jdk17', 'jdk21'], description: 'The JDK base image version to use for the TCK image.')
33+
choice(name: 'IMAGE_JDK', choices: ['jdk17', 'jdk25'], description: 'The JDK base image version to use for the TCK image.')
3434
string(name: 'TCK_VERSION', defaultValue: '3.2.0', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
3535
string(name: 'TCK_SHA', defaultValue: '', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
3636
string(name: 'TCK_URL', defaultValue: 'https://www.eclipse.org/downloads/download.php?file=/ee4j/jakartaee-tck/jakartaee11/staged/eftl/jakarta-persistence-tck-3.2.0.zip&mirror_id=1', description: 'The URL from which to download the TCK ZIP file. Only needed for testing staged builds. Ensure the TCK_VERSION variable matches the ZIP file name suffix.')

ci/release/Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pipeline {
7070
cron('0 0 * * 0')
7171
}
7272
tools {
73-
jdk 'OpenJDK 21 Latest'
73+
jdk 'OpenJDK 25 Latest'
7474
}
7575
options {
7676
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')

ci/snapshot-publish.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pipeline {
2323
label 'Release'
2424
}
2525
tools {
26-
jdk 'OpenJDK 21 Latest'
26+
jdk 'OpenJDK 25 Latest'
2727
}
2828
options {
2929
rateLimitBuilds(throttle: [count: 1, durationName: 'hour', userBoost: true])

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ org.gradle.java.installations.auto-download=false
2727

2828
# externalized definition of JDK versions so that they are available in both Project (build.gradle) and Settings (settings.gradle)
2929
orm.jdk.base=17
30-
orm.jdk.min=21
30+
orm.jdk.min=25
3131
# See gradlew/wrapper/gradle-wrapper.properties, https://docs.gradle.org/current/userguide/compatibility.html#java_runtime
32-
orm.jdk.max=22
32+
orm.jdk.max=25
3333

3434
# The minimum version of Gradle supported for the ORM Gradle plugin.
3535
# This is the version used in the plugin tests, used to make sure we do not break compatibility.

hibernate-core/src/main/java/org/hibernate/EnabledFetchProfile.java

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,60 @@
77
import jakarta.persistence.FindOption;
88
import org.hibernate.query.SelectionQuery;
99

10-
/**
11-
* A {@link jakarta.persistence.FindOption} which requests a named
12-
* {@linkplain org.hibernate.annotations.FetchProfile fetch profile}.
13-
* <p>
14-
* An instance of this class may be obtained in a type safe way
15-
* from the static metamodel for the class annotated
16-
* {@link org.hibernate.annotations.FetchProfile @FetchProfile}.
17-
* <p>
18-
* For example, this class defines a fetch profile:
19-
* <pre>
20-
* &#064;Entity
21-
* &#064;FetchProfile(name = "WithAuthors")
22-
* class Book {
23-
* ...
24-
*
25-
* &#064;ManyToMany
26-
* &#064;FetchProfileOverride(profile = Book_.PROFILE_WITH_AUTHORS)
27-
* Set&lt;Author&gt; authors;
28-
* }
29-
* </pre>
30-
* <p>
31-
* An {@code EnabledFetchProfile} may be obtained from the static
32-
* metamodel for the entity {@code Book} and passed as an option to
33-
* {@link Session#find(Class, Object, FindOption...) find()}.
34-
* <pre>
35-
* Book bookWithAuthors =
36-
* session.find(Book.class, isbn, Book_._WithAuthors)
37-
* </pre>
38-
* Alternatively, it may be {@linkplain #enable(Session) applied}
39-
* to a {@code Session} or {@code Query}.
40-
* <pre>
41-
* Book_._WithAuthors.enable(session);
42-
* Book bookWithAuthors = session.find(Book.class, isbn);
43-
* </pre>
44-
* <p>
45-
* When the static metamodel is not used, an {@code EnabledFetchProfile}
46-
* may be instantiated directly, passing the name of the fetch profile
47-
* as a string.
48-
* <pre>
49-
* Book bookWithAuthors =
50-
* session.find(Book.class, isbn,
51-
* new EnabledFetchProfile("WithAuthors"))
52-
* </pre>
53-
*
54-
* @param profileName the {@linkplain org.hibernate.annotations.FetchProfile#name profile name}
55-
*
56-
* @since 7.0
57-
*
58-
* @see org.hibernate.annotations.FetchProfile
59-
* @see Session#find(Class, Object, FindOption...)
60-
*
61-
* @author Gavin King
62-
*/
10+
/// A [jakarta.persistence.FindOption] which represents a named
11+
/// [fetch profile][org.hibernate.annotations.FetchProfile].
12+
///
13+
/// An instance of this class may be obtained in a type safe way
14+
/// from the static metamodel for the class annotated with the
15+
/// [@FetchProfile][org.hibernate.annotations.FetchProfile].
16+
///
17+
/// For example, this class defines a fetch profile:
18+
/// ```java
19+
/// @Entity
20+
/// @FetchProfile(name = "WithAuthors")
21+
/// class Book {
22+
/// ...
23+
/// @ManyToMany
24+
/// @FetchProfileOverride(profile = Book_.PROFILE_WITH_AUTHORS)
25+
/// Set<Author> authors;
26+
/// }
27+
/// ```
28+
///
29+
/// An `EnabledFetchProfile` may be obtained from the static
30+
/// metamodel for the entity {@code Book} and passed as an option to
31+
/// [Session#find(Class, Object, FindOption...)].
32+
///
33+
/// ```java
34+
/// Book bookWithAuthors =
35+
/// session.find(Book.class, isbn, Book_._WithAuthors)
36+
/// ```
37+
///
38+
/// Alternatively, it may be [applied][#enable(Session)]
39+
/// to a `Session` or `Query`.
40+
///
41+
/// ```java
42+
/// Book_._WithAuthors.enable(session);
43+
/// Book bookWithAuthors = session.find(Book.class, isbn);
44+
/// ```
45+
///
46+
/// When the static metamodel is not used, an `EnabledFetchProfile`
47+
/// may be instantiated directly, passing the name of the fetch profile
48+
/// as a string.
49+
///
50+
/// ```java
51+
/// Book bookWithAuthors =
52+
/// session.find(Book.class, isbn,
53+
/// new EnabledFetchProfile("WithAuthors"))
54+
/// ```
55+
///
56+
/// @param profileName the [profile name][org.hibernate.annotations.FetchProfile#name].
57+
///
58+
/// @since 7.0
59+
///
60+
/// @see org.hibernate.annotations.FetchProfile
61+
/// @see Session#find(Class, Object, FindOption...)
62+
///
63+
/// @author Gavin King
6364
public record EnabledFetchProfile(String profileName)
6465
implements FindOption {
6566

0 commit comments

Comments
 (0)