Catch UnsupportedOperationException thrown by SecurityManager in Java 21
src/main/java/org/codehaus/mojo/antlr/AbstractAntlrMojo.java
sets SecurityManager in order to catch System.exit() call. setSecurityManager() throws UnsupportedOperationException if java.security.manager property is not set in Java 21. Previously it was throwing only SecurityException.
Testing:
libhibernate3-java depends on antlr-maven-plugin.
Building libhibernate3-java with default Java 21 fails with
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:antlr-maven-plugin:2.2:generate (default) on project hibernate-core: Execution default of goal org.codehaus.mojo:antlr-maven-plugin:2.2:generate failed: The Security Manager is deprecated and will be removed in a future release -> [Help 1]
Building with the patched antlr-maven-plugin in sid chroot results in a successful build.
Edited by Vladimir Petko