diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ff5ab00f9f3..3a9ae23fce0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -219,9 +219,6 @@ jobs: S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - # The following option `--add-opens=java.base/java.nio=ALL-UNNAMED` is required jdk17+ - # to avoid error. See https://arrow.apache.org/docs/java/install.html#java-compatibility - _JAVA_OPTIONS: ${{ env._JAVA_OPTIONS }} --add-opens=java.base/java.nio=ALL-UNNAMED with: job-id: jdk${{ matrix.jdk }} remote-build-cache-proxy-enabled: false @@ -248,9 +245,6 @@ jobs: S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - # The following option `--add-opens=java.base/java.nio=ALL-UNNAMED` is required jdk17+ - # to avoid error. See https://arrow.apache.org/docs/java/install.html#java-compatibility - _JAVA_OPTIONS: ${{ env._JAVA_OPTIONS }} --add-opens=java.base/java.nio=ALL-UNNAMED with: job-id: jdk${{ matrix.jdk }} remote-build-cache-proxy-enabled: false @@ -320,9 +314,6 @@ jobs: S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - # The following option `--add-opens=java.base/java.nio=ALL-UNNAMED` is required jdk17+ - # to avoid error. See https://arrow.apache.org/docs/java/install.html#java-compatibility - _JAVA_OPTIONS: ${{ env._JAVA_OPTIONS }} --add-opens=java.base/java.nio=ALL-UNNAMED with: job-id: jdk19 remote-build-cache-proxy-enabled: false diff --git a/Jenkinsfile b/Jenkinsfile index bd4216c05e42..53cc1e6f31fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,9 +41,7 @@ node('ubuntu') { } stage('Code Quality') { timeout(time: 1, unit: 'HOURS') { - // The following option `--add-opens=java.base/java.nio=ALL-UNNAMED` is required jdk17+ - // to avoid error. See https://arrow.apache.org/docs/java/install.html#java-compatibility - withEnv(["Path+JDK=$JAVA_JDK_17/bin","JAVA_HOME=$JAVA_JDK_17","_JAVA_OPTIONS=--add-opens=java.base/java.nio=ALL-UNNAMED"]) { + withEnv(["Path+JDK=$JAVA_JDK_17/bin","JAVA_HOME=$JAVA_JDK_17"]) { withCredentials([string(credentialsId: 'SONARCLOUD_TOKEN', variable: 'SONAR_TOKEN')]) { if ( env.BRANCH_NAME.startsWith("PR-") ) { sh './gradlew --no-parallel --no-daemon jacocoAggregateTestReport sonar -PenableJacoco -Dsonar.pullrequest.branch=${CHANGE_BRANCH} -Dsonar.pullrequest.base=${CHANGE_TARGET} -Dsonar.pullrequest.key=${CHANGE_ID} -Dsonar.login=${SONAR_TOKEN}' diff --git a/arrow/build.gradle.kts b/arrow/build.gradle.kts index 0ed73e8ddf31..402ad4f03d32 100644 --- a/arrow/build.gradle.kts +++ b/arrow/build.gradle.kts @@ -14,6 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import com.github.vlsi.gradle.dsl.configureEach + dependencies { api(project(":core")) @@ -30,3 +32,12 @@ dependencies { testImplementation(project(":core")) testImplementation(project(":testkit")) } + +plugins.withType { + tasks { + configureEach { + jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") + jvmArgs("--add-opens=java.base/java.nio=ALL-UNNAMED") + } + } +}