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

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


The following commit(s) were added to refs/heads/main by this push:
     new 067ca0c4bc [#8628] fix(build): Skip tests in release task to avoid JDK 
version conflicts (#9316)
067ca0c4bc is described below

commit 067ca0c4bcee18fa15e5757118c6075ed1d5e715
Author: Jerry Shao <[email protected]>
AuthorDate: Tue Dec 2 14:56:36 2025 +0800

    [#8628] fix(build): Skip tests in release task to avoid JDK version 
conflicts (#9316)
    
    ### What changes were proposed in this pull request?
    
    Fix the `release` task to avoid JDK version conflicts when running
    tests.
    
    ### Why are the changes needed?
    
    Issue: #8628
    
    The `./gradlew release` command fails because:
    - The release task depends on all subproject `build` tasks, which
    include running tests
    - Some modules (clients, spark-connector, flink-connector, bundles, api,
    common) are JDK 8 compatible
    - Other modules (server, core, catalogs) require JDK 17
    - When tests run during release, there are JDK version conflicts causing
    failures
    - The workaround `./gradlew release -x test` works but is not ideal
    
    ### How was this patch tested?
    
    1. Ran `./gradlew clean` to clean all build artifacts
    2. Ran `./gradlew release` successfully (53s, 425 tasks)
    3. Verified all 53 module JARs have correct bytecode versions:
    - 26 JARs are JDK 8 compatible (bytecode 52.0): clients, connectors,
    bundles, api, common
    - 27 JARs are JDK 17 (bytecode 61.0): server, core, catalogs,
    authorization modules
    4. Confirmed the release completes without requiring `-x test`
    
    ### Change logs
    
    - Modified release task to depend on `assemble` instead of `build`
    - This skips test execution during release to avoid JDK version
    conflicts
    - Tests should be run separately in CI/CD with appropriate JDK
    configurations
    - Added filter to exclude `client-python` which doesn't have an assemble
    task
    - Added comments explaining the rationale
    
    Fixes #8628
---
 build.gradle.kts | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/build.gradle.kts b/build.gradle.kts
index dbac9bbf74..c807b4e126 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1181,5 +1181,13 @@ tasks.register("release") {
     println("Releasing project...")
   }
 
-  dependsOn(subprojects.map { it.tasks.named("build") })
+  // Use 'assemble' instead of 'build' to skip tests during release
+  // Tests have JDK version conflicts (some need JDK 8, some need JDK 17)
+  // and should be run separately in CI/CD with appropriate JDK configurations
+  // Only include subprojects that apply the Java plugin (exclude 
client-python)
+  dependsOn(
+    subprojects
+      .filter { it.name != "client-python" }
+      .map { it.tasks.named("assemble") }
+  )
 }

Reply via email to