Resolve Java 21 FTBFS
This MR fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052589
Note: alternative is to provide a new upstream release (2.0.0AM27) that depends on BouncyCastle for the certificate operations rather than on internal sun.* API.
Changes:
- use reflection to workaround internal API breakage between Java 17 and 21.
- add missing --add-opens for sun.security.x509 (crash on startup)
Testing:
- build in sid chroot
- build in default Java 21 sid chroot
- installed and started with default settings in default Java 21 sid vm and default Java 17 vm
- ran apacheds core tests (added
<argLine>-Djava.awt.headless=true -Xmx256m --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.base/sun.security.x509=ALL-UNNAMED</argLine>
to surefire plugin configuration and set -Dcheckstyle.skip=true)