diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4bde8ddb75..e3941fa9fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -298,6 +298,8 @@ jobs: contains(github.event.pull_request.labels.*.name, 'ci:jdk-compatibility') || inputs.jdk_compatibility_ci == true runs-on: ubuntu-latest + # early-access JDK builds are allowed to fail without failing the workflow + continue-on-error: ${{ matrix.experimental == true }} strategy: fail-fast: false #Even if the tests fail on one JDK we want to know if it also fails on others matrix: @@ -315,7 +317,11 @@ jobs: maven_test_args: '-Dnet.bytebuddy.safe=false' - version: '28-ea' distribution: 'temurin' + experimental: true maven_test_args: '-Dnet.bytebuddy.safe=false' + # JDK 28 disables ReflectionFactory.newConstructorForSerialization, which Objenesis (Mockito) relies on. + # Passed as an env var rather than -DargLine because some modules (dubbo, spring-webmvc, ...) hard-code in their pom. + java_tool_options: '-Djdk.reflect.allowNonSerializableConstruction=true' steps: - uses: actions/checkout@v7 - uses: ./.github/workflows/maven-goal-jdk @@ -324,6 +330,9 @@ jobs: test-java-distribution: ${{ matrix.distribution }} command: ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true - name: Run tests for ${{ matrix.version }}:${{ matrix.distribution }} + env: + # only set for the matrix entries that define it (empty otherwise) + JAVA_TOOL_OPTIONS: ${{ matrix.java_tool_options }} run: ./mvnw test -Delastic.jdkCompatibilityTest=true -Dtest_java_binary=${{ env.TEST_JAVA_BINARY }} -Dtest_java_version=${{ matrix.version }} ${{ matrix.maven_test_args }} - name: Store test results if: success() || failure()