This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch fix/linkoffline-comma-path in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
commit 7e8d98587cd66ce3e01739d0fc1c5e8bdd78277b Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Tue Nov 10 21:36:50 2026 +0100 Fix -linkoffline comma-path splitting for JDK 11 The -linkoffline option combined URL and location into a single argument with splitValue=true (default), causing StringTokenizer to split the combined value on commas. When the location path contains a comma (e.g., /unit/commapath,test), JDK 11 misparses the options file and fails with errors like 'Error reading file: -quiet/element-list'. This mirrors the fix applied to -d in PR #1413 (commit 88ca852), which passed splitValue=false to prevent comma tokenization. -linkoffline now uses the same pattern, matching how single-value options (-bottom, -doctitle, etc.) are already handled. Fixes testCommaPath failure on JDK 11 exposed by PR #1441. --- .../java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java index e90c1080..c88909b8 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java @@ -3683,11 +3683,14 @@ public abstract class AbstractJavadocMojo extends AbstractMojo { continue; } if (isValidJavadocLink(location, false)) { + // Use splitValue=false to prevent tokenizing on commas, + // since -linkoffline takes exactly one URL and one location (single path, not a list). + // JDK 11 misparses comma-containing paths in argument files when they are split. addArgIfNotEmpty( arguments, "-linkoffline", JavadocUtil.quotedPathArgument(url) + " " + JavadocUtil.quotedPathArgument(location), - true); + true, false); } } }
