This is an automated email from the ASF dual-hosted git repository.

jark pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss.git


The following commit(s) were added to refs/heads/main by this push:
     new 7f702654e [build] Upgrade default JDK compile version to 11  (#1197)
7f702654e is described below

commit 7f702654eaab8a6c7881a1f0e1263e9d0e36bd8c
Author: Hongshun Wang <[email protected]>
AuthorDate: Mon Aug 11 14:08:39 2025 +0800

    [build] Upgrade default JDK compile version to 11  (#1197)
---
 .github/workflows/{ci.yaml => ci-template.yaml} | 36 +++++++------
 .github/workflows/ci.yaml                       | 54 +++++++-------------
 .github/workflows/license-check.yml             |  2 +-
 .github/workflows/nightly.yaml                  | 34 +++++++++++++
 pom.xml                                         | 67 +++++++++++++++++++++++--
 5 files changed, 138 insertions(+), 55 deletions(-)

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci-template.yaml
similarity index 83%
copy from .github/workflows/ci.yaml
copy to .github/workflows/ci-template.yaml
index f706a2552..f6676aa5f 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci-template.yaml
@@ -15,21 +15,21 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
################################################################################
-name: CI
-on:
-  push:
-    branches:
-      - main
-      - release-**
-      - ci-**
-  pull_request:
-    paths-ignore:
-      - 'website/**'
-      - '**/*.md'
-concurrency:
-  group: ${{ github.workflow }}-${{ github.event_name }}-${{ 
github.event.number || github.run_id }}
-  cancel-in-progress: true
 
+# .github/workflows/ci-template.yaml
+name: CI Template
+
+on:
+  workflow_call:
+    inputs:
+      java-version:
+        required: true
+        type: string
+      maven-parameters:
+        description: "Any parameters of the Maven command."
+        required: false
+        type: string
+        default: ""
 jobs:
   build:
     runs-on: self-hosted
@@ -37,9 +37,15 @@ jobs:
       fail-fast: false
       matrix:
         module: [ core, flink ]
+    name: "${{ matrix.module }}"
     steps:
       - name: Checkout code
         uses: actions/checkout@v2
+      - name: Set up JDK
+        uses: actions/setup-java@v4
+        with:
+          java-version: ${{ inputs.java-version }}
+          distribution: 'temurin'
       - name: Build
         run: |
           mvn -T 1C -B clean install -DskipTests
@@ -49,7 +55,7 @@ jobs:
           TEST_MODULES=$(./.github/workflows/stage.sh ${{ matrix.module }})
           echo "github ref: ${{ github.ref }}"
           echo "Start testing modules: $TEST_MODULES"
-          mvn -B verify $TEST_MODULES -Ptest-coverage -Ptest-${{ matrix.module 
}} -Dlog.dir=${{ runner.temp }}/fluss-logs -Dlog4j.configurationFile=${{ 
github.workspace }}/tools/ci/log4j.properties
+          mvn -B verify $TEST_MODULES -Ptest-coverage -Ptest-${{ matrix.module 
}} -Dlog.dir=${{ runner.temp }}/fluss-logs -Dlog4j.configurationFile=${{ 
github.workspace }}/tools/ci/log4j.properties ${{ inputs.maven-parameters }}
         env:
           MAVEN_OPTS: -Xmx4096m
           ARTIFACTS_OSS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_ENDPOINT }}
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index f706a2552..54ce0d077 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -22,52 +22,36 @@ on:
       - main
       - release-**
       - ci-**
+    paths-ignore:
+      - 'website/**'
+      - '**/*.md'
   pull_request:
     paths-ignore:
       - 'website/**'
       - '**/*.md'
+
 concurrency:
   group: ${{ github.workflow }}-${{ github.event_name }}-${{ 
github.event.number || github.run_id }}
   cancel-in-progress: true
 
 jobs:
-  build:
-    runs-on: self-hosted
-    strategy:
-      fail-fast: false
-      matrix:
-        module: [ core, flink ]
+  compile-on-jdk8:
+    name: "Compile Java 8"
+    runs-on: ubuntu-latest
     steps:
       - name: Checkout code
         uses: actions/checkout@v2
+      - name: Set up JDK 8
+        uses: actions/setup-java@v4
+        with:
+          java-version: '8'
+          distribution: 'temurin'
       - name: Build
         run: |
-          mvn -T 1C -B clean install -DskipTests
-      - name: Test
-        timeout-minutes: 60
-        run: |
-          TEST_MODULES=$(./.github/workflows/stage.sh ${{ matrix.module }})
-          echo "github ref: ${{ github.ref }}"
-          echo "Start testing modules: $TEST_MODULES"
-          mvn -B verify $TEST_MODULES -Ptest-coverage -Ptest-${{ matrix.module 
}} -Dlog.dir=${{ runner.temp }}/fluss-logs -Dlog4j.configurationFile=${{ 
github.workspace }}/tools/ci/log4j.properties
-        env:
-          MAVEN_OPTS: -Xmx4096m
-          ARTIFACTS_OSS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_ENDPOINT }}
-          ARTIFACTS_OSS_REGION: ${{ secrets.ARTIFACTS_OSS_REGION }}
-          ARTIFACTS_OSS_BUCKET: ${{ secrets.ARTIFACTS_OSS_BUCKET }}
-          ARTIFACTS_OSS_ACCESS_KEY: ${{ secrets.ARTIFACTS_OSS_ACCESS_KEY }}
-          ARTIFACTS_OSS_SECRET_KEY: ${{ secrets.ARTIFACTS_OSS_SECRET_KEY }}
-          ARTIFACTS_OSS_STS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_STS_ENDPOINT }}
-          ARTIFACTS_OSS_ROLE_ARN: ${{ secrets.ARTIFACTS_OSS_ROLE_ARN }}
-      - name: Upload build logs
-        uses: actions/upload-artifact@v4
-        if: ${{ failure() }}
-        with:
-          name: logs-test-${{ matrix.module }}-${{ github.run_number}}#${{ 
github.run_attempt }}
-          path: ${{ runner.temp }}/fluss-logs/*
-      - name: Upload JaCoCo coverage report
-        uses: actions/upload-artifact@v4
-        if: ${{ success() && github.ref == 'refs/heads/main' }}
-        with:
-          name: jacoco-report-${{ matrix.module }}-${{ github.run_number}}#${{ 
github.run_attempt }}
-          path: ${{ github.workspace 
}}/fluss-test-coverage/target/site/jacoco-aggregate/*
\ No newline at end of file
+          mvn -T 1C -B clean install -DskipTests -Pjava8
+
+  build-on-jdk11:
+    name: "Java 11"
+    uses: ./.github/workflows/ci-template.yaml
+    with:
+        java-version: "11"
\ No newline at end of file
diff --git a/.github/workflows/license-check.yml 
b/.github/workflows/license-check.yml
index a830abaee..a54175d17 100644
--- a/.github/workflows/license-check.yml
+++ b/.github/workflows/license-check.yml
@@ -37,7 +37,7 @@ jobs:
       - name: Set JDK
         uses: actions/setup-java@v4
         with:
-          java-version: 8
+          java-version: 11
           distribution: 'temurin'
 
       - name: Build
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml
new file mode 100644
index 000000000..4836e10f5
--- /dev/null
+++ b/.github/workflows/nightly.yaml
@@ -0,0 +1,34 @@
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+name: Nightly
+on:
+  schedule:
+    # Run at 20:00 UTC daily which is the lowest traffic time for Fluss 
project.
+    - cron: "0 20 * * *"
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event_name }}-${{ 
github.event.number || github.run_id }}
+  cancel-in-progress: true
+
+jobs:
+  build-on-jdk8:
+    name: "Java 8"
+    uses: ./.github/workflows/ci-template.yaml
+    with:
+      java-version: "8"
+      maven-parameters: "-Pjava8"
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 8441ee50f..c033ea79b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,7 +82,7 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <target.java.version>1.8</target.java.version>
+        <target.java.version>11</target.java.version>
         <maven.compiler.source>${target.java.version}</maven.compiler.source>
         <maven.compiler.target>${target.java.version}</maven.compiler.target>
         <test.unit.pattern>**/*Test.*</test.unit.pattern>
@@ -143,6 +143,25 @@
           plugin executes before, the property is undefined and makes the 
tests fail. Thus we define an empty property
           here to make sure it doesn't fail. See also 
https://issues.apache.org/jira/browse/SUREFIRE-1431 -->
         <argLine/>
+        <extraJavaTestArgs>
+            -XX:+IgnoreUnrecognizedVMOptions
+            --add-opens=java.base/java.lang=ALL-UNNAMED
+            --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
+            --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
+            --add-opens=java.base/java.io=ALL-UNNAMED
+            --add-opens=java.base/java.net=ALL-UNNAMED
+            --add-opens=java.base/java.nio=ALL-UNNAMED
+            --add-opens=java.base/java.util=ALL-UNNAMED
+            --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
+            --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
+            --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED
+            --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
+            --add-opens=java.base/sun.nio.cs=ALL-UNNAMED
+            --add-opens=java.base/sun.security.action=ALL-UNNAMED
+            --add-opens=java.base/sun.util.calendar=ALL-UNNAMED
+            -Djdk.reflect.useDirectMethodHandle=false
+            -Dio.netty.tryReflectionSetAccessible=true
+        </extraJavaTestArgs>
     </properties>
 
     <dependencies>
@@ -425,6 +444,29 @@
     </dependencyManagement>
 
     <profiles>
+        <profile>
+            <id>java8</id>
+            <properties>
+                <target.java.version>1.8</target.java.version>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-compiler-plugin</artifactId>
+                        <configuration>
+                            <source>${target.java.version}</source>
+                            <target>${target.java.version}</target>
+                            
<useIncrementalCompilation>false</useIncrementalCompilation>
+                            <compilerArgs >
+                                <!-- Prevents recompilation due to missing 
package-info.class, see MCOMPILER-205 -->
+                                <arg>-Xpkginfo:always</arg>
+                            </compilerArgs>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
         <profile>
             <id>test-coverage</id>
             <properties>
@@ -510,6 +552,22 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.0</version>
+                <configuration>
+                    <source>${target.java.version}</source>
+                    <target>${target.java.version}</target>
+                    <!-- The semantics of this option are reversed, see 
MCOMPILER-209. -->
+                    
<useIncrementalCompilation>false</useIncrementalCompilation>
+                    <compilerArgs >
+                        
<arg>--add-exports=java.base/sun.net.util=ALL-UNNAMED</arg>
+                        
<arg>--add-exports=java.management/sun.management=ALL-UNNAMED</arg>
+                        
<arg>--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED</arg>
+                        
<arg>--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED</arg>
+                        
<arg>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</arg>
+                        <!-- Prevents recompilation due to missing 
package-info.class, see MCOMPILER-205 -->
+                        <arg>-Xpkginfo:always</arg>
+                    </compilerArgs>
+                </configuration>
             </plugin>
 
             <plugin>
@@ -639,7 +697,7 @@
                         
<junit.jupiter.execution.parallel.config.strategy>dynamic
                         </junit.jupiter.execution.parallel.config.strategy>
                     </systemPropertyVariables>
-                    <argLine>@{argLine} -Xms256m -Xmx2048m 
-XX:+UseG1GC</argLine>
+                    <argLine>@{argLine} -Xms256m -Xmx2048m -XX:+UseG1GC 
${extraJavaTestArgs}</argLine>
                 </configuration>
                 <executions>
                     <!--execute all the unit tests-->
@@ -692,8 +750,8 @@
                         <configuration>
                             <rules>
                                 <requireMavenVersion>
-                                    <!-- enforce at least mvn version 3.1.1 
(see FLINK-12447) -->
-                                    <version>[3.1.1,)</version>
+                                    <!-- enforce at least mvn version 3.8.6 -->
+                                    <version>[3.8.6,)</version>
                                 </requireMavenVersion>
                                 <requireJavaVersion>
                                     <version>${target.java.version}</version>
@@ -879,6 +937,7 @@
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>3.8.0</version>
                     <configuration>
+                        <!-- Make sure that we only use Java 8 compatible APIs 
-->
                         <source>${target.java.version}</source>
                         <target>${target.java.version}</target>
                         <!-- The semantics of this option are reversed, see 
MCOMPILER-209. -->

Reply via email to