You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/08/10 21:46:18 UTC

(maven-dependency-plugin) 01/01: Use a MojoExecutionException constructor that exists in Maven 3.6.3

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch fix-1682-baseline-ctor
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit e1c5da3d6e4e2023f097f96b607217c80ca3a445
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Mon Aug 10 23:40:15 2026 +0200

    Use a MojoExecutionException constructor that exists in Maven 3.6.3
    
    MojoExecutionException(Throwable) arrived in Maven 3.9.0, so on the version
    <prerequisites> 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)
---
 .../plugins/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 00a78b09..7a794db5 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 @@ public class RenderDependenciesMojo extends AbstractDependencyFilterMojo {
             try {
                 Files.createDirectories(parent);
             } catch (final IOException e) {
-                throw new MojoExecutionException(e);
+                throw new MojoExecutionException("Error while creating directory '" + parent + "'", e);
             }
         }