Commit 48b3166
Add JAR integration test for JDK compatibility (#704)
* Add Enable-Native-Access manifest attribute for JDK 24+
Add the Enable-Native-Access: ALL-UNNAMED attribute to the JAR manifest
to suppress native access warnings on JDK 24+ without requiring users
to add the --enable-native-access=ALL-UNNAMED command-line flag.
This manifest attribute allows the library to declare its need for
native access, which helps suppress the warnings introduced by JEP 472
when snappy-java loads native libraries via JNI.
Benefits:
- Users no longer need to add JVM flags for basic usage
- Warnings are suppressed automatically when the JAR is on the classpath
- Backwards compatible with all JDK versions (attribute is ignored on JDK < 24)
Related to #689
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add integration test for JAR manifest and native access
Add a comprehensive integration test that verifies snappy-java works
in a separate JVM process. This test:
1. Builds the JAR with sbt
2. Compiles a simple test program that uses snappy-java
3. Runs the test in a fresh JVM WITHOUT --enable-native-access flag
4. Verifies the compression/decompression works correctly
5. Checks for JEP 472 warnings on JDK 24+
The test can be run two ways:
- Via JUnit: testOnly org.xerial.snappy.JarManifestIntegrationTest
- Via script: ./script/test-jar-integration.sh
Findings: The Enable-Native-Access manifest attribute is present but
does NOT suppress warnings when the JAR is used as a library on the
classpath. The attribute only works for executable JARs (java -jar).
Users still need to add --enable-native-access=ALL-UNNAMED for now.
Related to #689
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Clean up and finalize integration test
Changes:
- Remove Enable-Native-Access manifest attribute (doesn't work for library JARs)
- Remove unused JUnit integration test (using shell script instead)
- Add JAR integration test to CI workflow for all JDK versions
The integration test now runs in CI after regular tests, verifying that
the built JAR works correctly in a separate JVM process on each tested
JDK version (8, 11, 17, 21, 25).
Related to #689
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Remove unnecessary manifest check from integration test
The manifest check is no longer needed since we decided not to
include the Enable-Native-Access attribute.
Related to #689
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3e32cbb commit 48b3166
File tree
3 files changed
+95
-0
lines changed- .github/workflows
- script
- src/test/resources/integration
3 files changed
+95
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments