maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject [maven-help-plugin] 27/37: PR: MNG-122 exception clean up phase 2
Date Wed, 20 Dec 2017 09:35:20 GMT
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-help-plugin-2.0
in repository https://gitbox.apache.org/repos/asf/maven-help-plugin.git

commit 0edacc4c636bf805e0d860ce51c90ca285b35447
Author: Brett Leslie Porter <brett@apache.org>
AuthorDate: Thu Oct 13 06:50:22 2005 +0000

    PR: MNG-122
    exception clean up phase 2
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-projecthelp-plugin@320675
13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/maven/plugins/projecthelp/DescribeMojo.java   | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/projecthelp/DescribeMojo.java b/src/main/java/org/apache/maven/plugins/projecthelp/DescribeMojo.java
index b3d1f84..9ac2124 100644
--- a/src/main/java/org/apache/maven/plugins/projecthelp/DescribeMojo.java
+++ b/src/main/java/org/apache/maven/plugins/projecthelp/DescribeMojo.java
@@ -23,6 +23,7 @@ import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.InvalidPluginException;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.PluginManager;
@@ -276,15 +277,7 @@ public class DescribeMojo
 
             if ( descriptor == null )
             {
-                try
-                {
-                    forLookup = pluginManager.getPluginDefinitionForPrefix( pi.prefix, session,
project );
-                }
-                catch ( PluginManagerException e )
-                {
-                    throw new MojoExecutionException(
-                        "Cannot resolve plugin-prefix: \'" + pi.prefix + "\' from plugin
mappings metadata.", e );
-                }
+                forLookup = pluginManager.getPluginDefinitionForPrefix( pi.prefix, session,
project );
             }
         }
         else if ( pi.groupId != null && pi.artifactId != null )
@@ -336,6 +329,11 @@ public class DescribeMojo
                 throw new MojoExecutionException( "Error retrieving plugin descriptor for:\n\ngroupId:
\'" + groupId +
                     "\'\nartifactId: \'" + artifactId + "\'\nversion: \'" + version + "\'\n\n",
e );
             }
+            catch ( InvalidPluginException e )
+            {
+                throw new MojoExecutionException( "Error retrieving plugin descriptor for:\n\ngroupId:
\'" + groupId +
+                    "\'\nartifactId: \'" + artifactId + "\'\nversion: \'" + version + "\'\n\n",
e );
+            }
         }
 
         return descriptor;

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <commits@maven.apache.org>.

Mime
View raw message