jena
jena copied to clipboard
Update jena-text to use Lucene in a Java21 compatible way.
The upgrade of lucene 9.10. -> 9.11.0 #2532 causes the build output below.
Both these warnings need to be addressed by moving the jena-text code forward to the now-preferred Lucene way of doing things.
Building with a Java21 JDK, for release Java17 output:
Lucene 9.10.0:
[INFO] Running org.apache.jena.query.text.assembler.TestTextDatasetAssembler
Jun 10, 2024 11:47:38 AM org.apache.lucene.store.MemorySegmentIndexInputProvider <init>
INFO: Using MemorySegmentIndexInput with Java 21 or later; to disable start with -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false
Lucene 9.11.0:
[INFO] Running org.apache.jena.query.text.assembler.TestTextDatasetAssembler
WARNING: A restricted method in java.lang.foreign.Linker has been called
WARNING: java.lang.foreign.Linker::downcallHandle has been called by the unnamed module
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for this module
Jun 10, 2024 11:45:22 AM org.apache.lucene.store.MemorySegmentIndexInputProvider <init>
INFO: Using MemorySegmentIndexInput and native madvise support with Java 21 or later; to disable start with -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false
Are you interested in contributing a pull request for this task?
None
I've thought a bit about this issue.
Lucene 10 which was just released requires minimum java-21. What does this mean for Apache Jena? Should it be moved out into its own artifact like geosparql, with documentation, or should Apache Jena stay at 9? Will there be more releases for the 9 branch?
In regards to cleaning the build, I tested using profiles for different args, based on jvm versions in https://github.com/apache/jena/pull/2782 which seems to work, from looking at the github action logs. I updated the java version in the github action so that the warnings could be seen. . Afaik from reading up on this, the fixes for the warnings are now using flags (and for 22+ adding stuff to manifests).
This just fixes the build, the same output is present when running the server itself. Maybe examples in the systemd file for setting the args could be relevant, and update to docs?
Jena requires Java17 currently. The project policy is "2 LTS". After Java-maybe-25 in September 2025, Jena will presumably move to require a minimum of 21. Hence, the default position for Jena is it stays at Lucene 9.12.x for at least a year.
What do jena-text users want?
I don't know what you mean by "own artifact" - istn't that what jena-text is?
I mean jena-text is currently in the binary distribution (e.g https://dlcdn.apache.org/jena/binaries/apache-jena-fuseki-5.2.0.tar.gz) , so you don't need to download it as a separate module. My thought of reasoning was with the 2 LTS version policy, then a separate module could require java 21, even if Apache Jena itself still supported 17 and 21.
I guess it depends on if Apache Lucene will have a 1 LTS policy for their releases, and if lagging slightly behind is an issue or not.
Apache Lucene has in the past been "2 major versions" and actually more.
I haven't checked - does 10.0.0 actual break anything?
Dependabot sent in a version 10.0.0 update - #2786. I have asked it to ignore the major version.
Apache Lucene has in the past been "2 major versions" and actually more.
I haven't checked - does 10.0.0 actual break anything?
It fails during compilation, when trying to build with java 17. It complains about wrong version:
/Users/oyvindlgjesdal/.m2/repository/org/apache/lucene/lucene-core/10.0.0/lucene-core-10.0.0.jar(/org/apache/lucene/store/Directory.class) class file has wrong version 65.0, should be 61.0
It looks like the upgrade works with no test-failures, when using java 21 during build.