[
https://issues.apache.org/jira/browse/MJAVADOC-751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17739928#comment-17739928
]
ASF GitHub Bot commented on MJAVADOC-751:
-----------------------------------------
sitepark-schaeper commented on PR #206:
URL:
https://github.com/apache/maven-javadoc-plugin/pull/206#issuecomment-1620308849
> This needs a test.
How would one go about testing this? Do we execute a test that executes the
javadoc executable and check wether the output is english? There would also
have to be a german/japanese/chinese environment to execute this test in as
doing so in only an english environments seems redundant.
> This might be a temporary workaround, but longer term I wonder if there's
a non-command line way to invoke Javadoc these days.
In Java 8 it should be as easy as:
```java
javax.tools.ToolProvider.getSystemDocumentationTool().run(in, out, err, args)
```
And in Java 9+:
```java
java.util.spi.ToolProvider.getSystemDocumentationTool().run(in, out, err,
args);
```
But if we do that than we cannot influence the output locale anymore as it
will always use `Locale.default()` (see
[here](https://github.com/openjdk/jdk/blob/master/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java#L136))
and therefore cannot parse it reliably.
> No warnings for localized output
> --------------------------------
>
> Key: MJAVADOC-751
> URL: https://issues.apache.org/jira/browse/MJAVADOC-751
> Project: Maven Javadoc Plugin
> Issue Type: Bug
> Components: javadoc
> Affects Versions: 3.5.0
> Reporter: Mario Schäper
> Priority: Minor
> Labels: easyfix, pull-request-available
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> If the output of the javadoc executable is localized the following two errors
> occur depending on the exit code:
> 1) non-zero: the informational output filter (introduced in MJAVADOC-721)
> does not work
> 2) zero: no warnings are recognized
>
> #2 is particularly problematic if `failOnWarnings` is set, since this may
> cause a build to fail in english environments, but not on certain others.
>
> Affected are japanese, chinese and since [JDK
> 19|[https://github.com/openjdk/jdk/commit/38df5701ff82|https://github.com/openjdk/jdk/commit/38df5701ff82)]]
> german.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)