Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORC-1852: Add --enable-native-access=ALL-UNNAMED to suppress Maven warnings #2131

Closed
wants to merge 1 commit into from

Conversation

dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Feb 16, 2025

What changes were proposed in this pull request?

This PR aims to add .mvn/jvm.config to java directory in order to enable --enable-native-access=ALL-UNNAMED for Maven.

Why are the changes needed?

Java 25-ea

$ java -version
openjdk version "25-ea" 2025-09-16
OpenJDK Runtime Environment (build 25-ea+10-1084)
OpenJDK 64-Bit Server VM (build 25-ea+10-1084, mixed mode, sharing)

BEFORE

$ mvn clean | head -n1
Running `/Users/dongjoon/APACHE/orc-merge/java/mvnw`...
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/opt/homebrew/Cellar/maven/3.9.9/libexec/lib/jansi-2.4.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Using `mvn` from path: /opt/homebrew/bin/mvn
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/opt/homebrew/Cellar/maven/3.9.9/libexec/lib/jansi-2.4.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
...

AFTER

$ mvn clean | head -n1
Running `/Users/dongjoon/APACHE/orc-merge/java/mvnw`...
Using `mvn` from path: /opt/homebrew/bin/mvn
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (file:/opt/homebrew/Cellar/maven/3.9.9/libexec/lib/guava-33.2.1-jre.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
[INFO] Scanning for projects...
...

How was this patch tested?

Pass the CIs and manual testing.

Was this patch authored or co-authored using generative AI tooling?

No.

@dongjoon-hyun dongjoon-hyun changed the title ORC-1852: Add java/.mvn/jvm.config with --enable-native-access=ALL-UNNAMED ORC-1852: Add --enable-native-access=ALL-UNNAMED to suppress Maven warnings Feb 16, 2025
@dongjoon-hyun dongjoon-hyun added this to the 2.2.0 milestone Feb 16, 2025
@dongjoon-hyun dongjoon-hyun deleted the ORC-1852 branch February 16, 2025 19:18
dongjoon-hyun added a commit that referenced this pull request Feb 18, 2025
…warnings

### What changes were proposed in this pull request?

This PR aims to add `.mvn/jvm.config` to `java` directory in order to enable `--enable-native-access=ALL-UNNAMED` for Maven.

### Why are the changes needed?

**Java 25-ea**
```
$ java -version
openjdk version "25-ea" 2025-09-16
OpenJDK Runtime Environment (build 25-ea+10-1084)
OpenJDK 64-Bit Server VM (build 25-ea+10-1084, mixed mode, sharing)
```

**BEFORE**
```
$ mvn clean | head -n1
Running `/Users/dongjoon/APACHE/orc-merge/java/mvnw`...
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/opt/homebrew/Cellar/maven/3.9.9/libexec/lib/jansi-2.4.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Using `mvn` from path: /opt/homebrew/bin/mvn
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/opt/homebrew/Cellar/maven/3.9.9/libexec/lib/jansi-2.4.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
...
```

**AFTER**
```
$ mvn clean | head -n1
Running `/Users/dongjoon/APACHE/orc-merge/java/mvnw`...
Using `mvn` from path: /opt/homebrew/bin/mvn
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (file:/opt/homebrew/Cellar/maven/3.9.9/libexec/lib/guava-33.2.1-jre.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
[INFO] Scanning for projects...
...
```

### How was this patch tested?

Pass the CIs and manual testing.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #2131 from dongjoon-hyun/ORC-1852.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit b9641c6)
Signed-off-by: Dongjoon Hyun <[email protected]>
@dongjoon-hyun dongjoon-hyun modified the milestones: 2.2.0, 2.1.1 Feb 18, 2025
@dongjoon-hyun
Copy link
Member Author

I backported this to branch-2.1 for Apache ORC 2.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant