Skip to content

Commit

Permalink
[MJAVADOC-810] [REGRESSION] MJAVADOC-791 causes forked Maven executio…
Browse files Browse the repository at this point in the history
…n fail if any toolchains or settings file isn't present

As request carries the "effective" value (default or user overriden
ones) but it does not mean they exist. And as invoker used,
effect is same as user would use -s/-t CLI commands with non-existent
files: mvn CLI failure.

Co-authored-by: Michael Osipov <michaelo@apache.org>

This closes #313
  • Loading branch information
cstamas authored and michael-o committed Aug 27, 2024
1 parent d9c0002 commit a424c6b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,18 @@ protected static void invokeMaven(
InvocationRequest request = new DefaultInvocationRequest();
request.setBaseDirectory(projectFile.getParentFile());
request.setPomFile(projectFile);
request.setGlobalSettingsFile(globalSettingsFile);
request.setUserSettingsFile(userSettingsFile);
request.setGlobalToolchainsFile(globalToolchainsFile);
request.setToolchainsFile(userToolchainsFile);
if (globalSettingsFile != null && globalSettingsFile.isFile()) {
request.setGlobalSettingsFile(globalSettingsFile);
}
if (userSettingsFile != null && userSettingsFile.isFile()) {
request.setUserSettingsFile(userSettingsFile);
}
if (globalToolchainsFile != null && globalToolchainsFile.isFile()) {
request.setGlobalToolchainsFile(globalToolchainsFile);
}
if (userToolchainsFile != null && userToolchainsFile.isFile()) {
request.setToolchainsFile(userToolchainsFile);
}
request.setBatchMode(true);
if (log != null) {
request.setDebug(log.isDebugEnabled());
Expand Down

0 comments on commit a424c6b

Please sign in to comment.