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 2020/09/26 13:17:59 UTC

[maven-source-plugin] 01/03: Handle multiple exception types

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

slachiewicz pushed a commit to branch sonar
in repository https://gitbox.apache.org/repos/asf/maven-source-plugin.git

commit a54455f08a9d8c9a93790efb85ddbda38e8757d9
Author: Piotrek Żygieło <pz...@users.noreply.github.com>
AuthorDate: Sat Sep 26 08:59:23 2020 +0200

    Handle multiple exception types
    
    https://rules.sonarsource.com/java/type/Code%20Smell/RSPEC-2147
---
 .../apache/maven/plugins/source/AbstractSourceJarMojo.java | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java b/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
index 641bd35..67e0392 100644
--- a/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
@@ -312,19 +312,7 @@ public abstract class AbstractSourceJarMojo
                 getLog().debug( "create archive " + outputFile );
                 archiver.createArchive( session, project, archive );
             }
-            catch ( IOException e )
-            {
-                throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(), e );
-            }
-            catch ( ArchiverException e )
-            {
-                throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(), e );
-            }
-            catch ( DependencyResolutionRequiredException e )
-            {
-                throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(), e );
-            }
-            catch ( ManifestException e )
+            catch ( IOException | ArchiverException | DependencyResolutionRequiredException | ManifestException e )
             {
                 throw new MojoExecutionException( "Error creating source archive: " + e.getMessage(), e );
             }