Skip to content

[DIRSTUDIO-1351] Generate the ACL parser without a Security Manager - #123

Open
zrhoffman wants to merge 1 commit into
apache:masterfrom
zrhoffman:fix/antlr-security-manager
Open

zrhoffman wants to merge 1 commit into
apache:masterfrom
zrhoffman:fix/antlr-security-manager

Conversation

@zrhoffman

@zrhoffman zrhoffman commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Fixes DIRSTUDIO-1351.

Builds on JDK 21 and newer fail in the OpenLDAP ACL editor module: antlr-maven-plugin 2.2 installs a Java Security Manager to trap System.exit() calls from the ANTLR tool. JDK 18+ rejects this by default ("The Security Manager is deprecated and will be removed"), and JDK 24+ no longer supports it ("Setting a Security Manager is not supported"). This breaks the "Build with OpenJDK 21" workflow and the CodeQL workflow, including the scheduled CodeQL runs on master.

Replace antlr-maven-plugin in both pom-first.xml and pom.xml of plugins/openldap.acl.editor with maven-antrun-plugin, which runs antlr.Tool (ANTLR 2.7.7) in a forked JVM during generate-sources and writes the lexer and parser to the same directory as before, target/generated-sources/antlr. In pom-first.xml, add build-helper-maven-plugin to register that directory as a source root, which antlr-maven-plugin did before. pom.xml does not need it because build.properties already lists the directory for Tycho.

Verified that the generated lexer, parser and token types match the antlr-maven-plugin output, that the full build (pom-first.xml and pom.xml) passes on JDK 17 and 21, and that the pom-first.xml build passes on JDK 25. The pom.xml build on JDK 25 fails for a separate reason: the JDK XML parser limits (#124, DIRSTUDIO-1352).

Fixes <https://issues.apache.org/jira/browse/DIRSTUDIO-1351>.

Builds on JDK 21 and newer fail in the OpenLDAP ACL editor module:
antlr-maven-plugin 2.2 installs a Java Security Manager to trap
System.exit() calls from the ANTLR tool. JDK 18+ rejects this by
default ("The Security Manager is deprecated and will be removed"),
and JDK 24+ no longer supports it ("Setting a Security Manager is not
supported"). This breaks the "Build with OpenJDK 21" workflow and the
CodeQL workflow, including the scheduled CodeQL runs on master.

Replace antlr-maven-plugin in both pom-first.xml and pom.xml of
plugins/openldap.acl.editor with maven-antrun-plugin, which runs
antlr.Tool (ANTLR 2.7.7) in a forked JVM during generate-sources and
writes the lexer and parser to the same directory as before,
target/generated-sources/antlr. In pom-first.xml, add
build-helper-maven-plugin to register that directory as a source root,
which antlr-maven-plugin did before. pom.xml does not need it because
build.properties already lists the directory for Tycho.

Verified that the generated lexer, parser and token types match the
antlr-maven-plugin output, that the full build (pom-first.xml and
pom.xml) passes on JDK 17 and 21, and that the pom-first.xml build
passes on JDK 25. The pom.xml build on JDK 25 fails for a separate
reason: the JDK XML parser limits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant