From 8882a9c599013182e42f0c7c321396c23b84dbe0 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sat, 29 May 2021 09:31:49 -0400 Subject: [PATCH] [MNG-7164] Add constructor MojoExecutionException(Throwable) This closes #474 --- .../plugin/AbstractMojoExecutionException.java | 12 ++++++++++++ .../apache/maven/plugin/MojoExecutionException.java | 13 +++++++++++++ .../apache/maven/plugin/MojoFailureException.java | 13 +++++++++++++ 3 files changed, 38 insertions(+) diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojoExecutionException.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojoExecutionException.java index 52aded3d654..e8df3095f21 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojoExecutionException.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojoExecutionException.java @@ -41,6 +41,18 @@ public AbstractMojoExecutionException( String message, Throwable cause ) super( message, cause ); } + /** + * Constructs a new {@code AbstractMojoExecutionException} exception wrapping an underlying {@code Throwable}. + * + * @param cause the cause which is saved for later retrieval by the {@link #getCause()} method. + * A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown. + * @since 3.8.3 + */ + public AbstractMojoExecutionException( Throwable cause ) + { + super( cause ); + } + public String getLongMessage() { return longMessage; diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoExecutionException.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoExecutionException.java index 4d8c416e077..6d089898600 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoExecutionException.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoExecutionException.java @@ -76,4 +76,17 @@ public MojoExecutionException( String message ) { super( message ); } + + /** + * Constructs a new {@code MojoExecutionException} exception wrapping an underlying {@code Throwable}. + * + * @param cause the cause which is saved for later retrieval by the {@link #getCause()} method. + * A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown. + * @since 3.8.3 + */ + public MojoExecutionException( Throwable cause ) + { + super( cause ); + } + } diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoFailureException.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoFailureException.java index 342d081f00b..72faec679eb 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoFailureException.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoFailureException.java @@ -65,4 +65,17 @@ public MojoFailureException( String message, Throwable cause ) { super( message, cause ); } + + /** + * Constructs a new {@code MojoFailureException} exception wrapping an underlying {@code Throwable}. + * + * @param cause the cause which is saved for later retrieval by the {@link #getCause()} method. + * A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown. + * @since 3.8.3 + */ + public MojoFailureException( Throwable cause ) + { + super( cause ); + } + }