Skip to content

Commit 3eb47c5

Browse files
committed
[MJAVADOC-791] maven-javadoc-plugin not working correctly together with maven-toolchains-plugin
This closes #299
1 parent d3afd39 commit 3eb47c5

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,9 @@ private void executeClirr() throws MavenInvocationException {
636636
properties,
637637
invokerLogFile,
638638
session.getRequest().getGlobalSettingsFile(),
639-
session.getRequest().getUserSettingsFile());
639+
session.getRequest().getUserSettingsFile(),
640+
session.getRequest().getGlobalToolchainsFile(),
641+
session.getRequest().getUserToolchainsFile());
640642

641643
try {
642644
if (invokerLogFile.exists()) {

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -5531,7 +5531,9 @@ private List<OfflineLink> getModulesLinks() throws MavenReportException {
55315531
null,
55325532
invokerLogFile,
55335533
session.getRequest().getGlobalSettingsFile(),
5534-
session.getRequest().getUserSettingsFile());
5534+
session.getRequest().getUserSettingsFile(),
5535+
session.getRequest().getGlobalToolchainsFile(),
5536+
session.getRequest().getUserToolchainsFile());
55355537
} catch (MavenInvocationException e) {
55365538
logError("MavenInvocationException: " + e.getMessage(), e);
55375539

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,8 @@ protected static void copyResource(URL url, File file) throws IOException {
715715
* @param invokerLog the log file where the invoker will be written, if null using <code>System.out</code>.
716716
* @param globalSettingsFile reference to settings file, could be null.
717717
* @param userSettingsFile reference to user settings file, could be null.
718+
* @param globalToolchainsFile reference to toolchains file, could be null.
719+
* @param userToolchainsFile reference to user toolchains file, could be null.
718720
* @throws MavenInvocationException if any
719721
* @since 2.6
720722
*/
@@ -726,7 +728,9 @@ protected static void invokeMaven(
726728
Properties properties,
727729
File invokerLog,
728730
File globalSettingsFile,
729-
File userSettingsFile)
731+
File userSettingsFile,
732+
File globalToolchainsFile,
733+
File userToolchainsFile)
730734
throws MavenInvocationException {
731735
if (projectFile == null) {
732736
throw new IllegalArgumentException("projectFile should be not null.");
@@ -763,6 +767,8 @@ protected static void invokeMaven(
763767
request.setPomFile(projectFile);
764768
request.setGlobalSettingsFile(globalSettingsFile);
765769
request.setUserSettingsFile(userSettingsFile);
770+
request.setGlobalToolchainsFile(globalToolchainsFile);
771+
request.setToolchainsFile(userToolchainsFile);
766772
request.setBatchMode(true);
767773
if (log != null) {
768774
request.setDebug(log.isDebugEnabled());

src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ private void invokeCompileGoal(File testPom, Log log) throws Exception {
547547
properties,
548548
invokerLogFile,
549549
null,
550+
null,
551+
null,
550552
null);
551553
}
552554

0 commit comments

Comments
 (0)