From e1c5da3d6e4e2023f097f96b607217c80ca3a445 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Mon, 10 Aug 2026 23:40:15 +0200 Subject: [PATCH] Use a MojoExecutionException constructor that exists in Maven 3.6.3 MojoExecutionException(Throwable) arrived in Maven 3.9.0, so on the version declares this branch raised NoSuchMethodError instead of the exception it meant to throw. Do not collapse it back to the single-argument form while the declared prerequisite is still 3.6.3. The message follows the sibling catch a few lines below, which already names the file it failed on. Verified: mvn -DmavenVersion=3.6.3 clean test-compile -> BUILD SUCCESS, and fails to compile without this change. Fixes #1682 Generated-by: Claude Opus 5 (1M context) --- .../dependency/fromDependencies/RenderDependenciesMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/RenderDependenciesMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/RenderDependenciesMojo.java index 00a78b09d..7a794db58 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/RenderDependenciesMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/RenderDependenciesMojo.java @@ -238,7 +238,7 @@ private void store(final String content, final File out) throws MojoExecutionExc try { Files.createDirectories(parent); } catch (final IOException e) { - throw new MojoExecutionException(e); + throw new MojoExecutionException("Error while creating directory '" + parent + "'", e); } }