Bug#1053206: antlr-maven-plugin fails with UnsupportedOperationException with Java 21

Vladimir Petko vladimir.petko at canonical.com
Fri Sep 29 09:39:35 BST 2023


Source: antlr-maven-plugin
X-Debbugs-Cc: vladimir.petko at canonical.com
Version: 2.2-5
Severity: important

Dear Maintainer,

src/main/java/org/codehaus/mojo/antlr/AbstractAntlrMojo.java sets
SecurityManager in order to catch System.exit() call.

This causes packages using it fail to build with the following message:
----
[ERROR] Failed to execute goal org.codehaus.mojo:antlr-maven-
plugin:2.2:generate (default) on project checkstyle: 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]
-----

because setSecurityManager() throws UnsupportedOperationException if
java.security.manager property is not set.

The attached patch adds UnsupportedOperationException to the catch statement
that bypasses the issue as the plugin already allows setSecurityManager() to
fail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: catch-security-manager-exception.patch
Type: text/x-patch
Size: 464 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20230929/84f21d77/attachment.bin>


More information about the pkg-java-maintainers mailing list