Make the JavaHL JAR an automatic module.
As described in [1], since version 24, the JVM will issue a warning for every
module that uses a restricted function (such as JNI calls). Later versions of
the JDK will default to throwing an exception.
To give our uses fine-grained control over access to restricted functions,
these changes declare the JavaHL JAR as a module and change the way we run
the JavaHL tests by building it first and running tests from there instead
of from the compiled classes tree. We explicitly allow JNI access only to
the org.apache.subversion.javahl module and deny it to anything else.
[1] https://inside.java/2024/12/09/quality-heads-up/
* build.conf: Make all Java targets depend on the $(JAVAHL_JAR).
* configure.ac: Look for the 'head' tool.
* build/ac-macros/java.m4
(SVN_FIND_JDK): Extract the Java version from the 'java' tool instead
of the 'javac' tool. If the Java version is 24 or greater, define ...
(JAVAHL_CHECK_FLAGS): ... to declare the module permissions for tests.
* Makefile.in
(INSTALL_EXTRA_JAVAHL_JAVA): Remove the install-time JAR creation. Instead,
($(JAVAHL_JAR):): ... add an explicit target to build the JAR.
(JAVAHL_CHECK_FLAGS): Gather common flags for JavaHL testing in one place.
(check-tigris-javahl, check-apache-javahl, check-deprecated-authn-javahl):
Depend on $(JAVAHL_JAR) and use $(JAVAHL_CHECK_FLAGS).
* subversion/bindings/javahl/Manifest.in: Add Automatic-Module-Name property.
git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1933892 13f79535-47bb-0310-9956-ffa450edef68
5 files changed