Skip to content

Commit d3afd39

Browse files
committed
[MJAVADOC-803] Add default parameter to force root locale
This closes #298
1 parent 4904e08 commit d3afd39

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java

+16
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,17 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
16531653
@Parameter(defaultValue = "${project.build.outputTimestamp}")
16541654
protected String outputTimestamp;
16551655

1656+
/**
1657+
* Forces the Javadoc JVM locale to be {@link Locale#ROOT}. This will force the Javadoc output
1658+
* on {@code stdout} and {@code stderr} to be in English only and the generated HTML content in
1659+
* English as well. If you need the generated HTML content in another supported language use
1660+
* {@link #locale}.
1661+
*
1662+
* @since 3.7.1
1663+
*/
1664+
@Parameter(property = "forceRootLocale", defaultValue = "true")
1665+
private boolean forceRootLocale;
1666+
16561667
// ----------------------------------------------------------------------
16571668
// protected methods
16581669
// ----------------------------------------------------------------------
@@ -1937,6 +1948,11 @@ protected void executeReport(Locale unusedLocale) throws MavenReportException {
19371948
addMemoryArg(cmd, "-Xms", this.minmemory);
19381949
addProxyArg(cmd);
19391950

1951+
if (forceRootLocale) {
1952+
cmd.createArg().setValue("-J-Duser.language=");
1953+
cmd.createArg().setValue("-J-Duser.country=");
1954+
}
1955+
19401956
if (additionalJOption != null && !additionalJOption.isEmpty()) {
19411957
cmd.createArg().setValue(additionalJOption);
19421958
}

0 commit comments

Comments
 (0)