gnodet opened a new pull request, #13606: URL: https://github.com/apache/maven/pull/13606
## Bug Maven Compiler Plugin passes its `jdkToolchain` requirements to the public `ToolchainManager#getToolchains(...)` API. In 3.10.x, `MisconfiguredToolchainException` was caught and logged silently, returning an empty list. The compiler plugin then fell back to the JDK running Maven and could report `BUILD SUCCESS` despite an explicitly requested malformed toolchain. This was fixed in 3.10.x by commit [`2ba1bbcd7c`](https://github.com/apache/maven/commit/2ba1bbcd7c) (author: Václav Haisman). ## Root cause in master Master's impl layer (`DefaultToolchainManager`) already propagates `ToolchainFactoryException` as `ToolchainManagerException` (unchecked), so the pure v4 path was never affected. However, in the **compat v3-to-v4 factory bridge** (`ToolchainManagerFactory.getDelegate()`), `MisconfiguredToolchainException` was wrapped as a plain `RuntimeException` instead of `ToolchainFactoryException`. This caused the exception to escape the impl's `catch (ToolchainFactoryException)` block and propagate as a raw `RuntimeException` without the contextual toolchain type info. ## Fix - Wrap `MisconfiguredToolchainException` as `ToolchainFactoryException` in the v3→v4 bridge, so the impl's `createToolchain()` catch block captures it and produces a proper `ToolchainManagerException` with the type info - Add `@throws` Javadoc to the v3 `ToolchainManager` interface - Add regression tests in both `impl/maven-impl` and `compat/maven-compat` ## References - 3.10.x fix: [`2ba1bbcd7c`](https://github.com/apache/maven/commit/2ba1bbcd7c) (PR [#12616](https://github.com/apache/maven/pull/12616)) - Original report: [maven-compiler-plugin#618](https://github.com/apache/maven-compiler-plugin/issues/618) --- _Hermes Agent (Claude Opus 4) on behalf of Guillaume Nodet_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
