You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/04/03 03:40:11 UTC

svn commit: r390935 - in /maven/plugins/trunk/maven-help-plugin: pom.xml src/main/java/org/apache/maven/plugins/help/DescribeMojo.java

Author: brett
Date: Sun Apr  2 18:40:09 2006
New Revision: 390935

URL: http://svn.apache.org/viewcvs?rev=390935&view=rev
Log:
[MPH-10] avoid NPE if plugin is not found

Modified:
    maven/plugins/trunk/maven-help-plugin/pom.xml
    maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java

Modified: maven/plugins/trunk/maven-help-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-help-plugin/pom.xml?rev=390935&r1=390934&r2=390935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-help-plugin/pom.xml Sun Apr  2 18:40:09 2006
@@ -1,4 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <artifactId>maven-plugins</artifactId>
     <groupId>org.apache.maven.plugins</groupId>
@@ -8,7 +10,7 @@
   <artifactId>maven-help-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Maven Help Plugin</name>
-  <version>2.1-SNAPSHOT</version>
+  <version>2.0.1-SNAPSHOT</version>
   <description>
     The Maven Help plugin provides goals aimed at helping to make sense out of
     the build environment. It includes the ability to view the effective

Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java?rev=390935&r1=390934&r2=390935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java (original)
+++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java Sun Apr  2 18:40:09 2006
@@ -60,7 +60,7 @@
 
     /**
      * The plugin/mojo to describe. This must be specified in one of three ways:
-     *
+     * <p/>
      * 1. plugin-prefix
      * 2. groupId:artifactId
      * 3. groupId:artifactId:version
@@ -345,6 +345,12 @@
                 getLog().debug( "Unable to find plugin version", e );
                 throw new MojoFailureException( e.getMessage() );
             }
+        }
+
+        if ( descriptor == null )
+        {
+            throw new MojoFailureException(
+                "Plugin could not be found. If you believe it is correct, check your pluginGroups setting, and run with -U to update the remote configuration" );
         }
 
         return descriptor;