From 43877dc10fdedecc4872c62dbb80ba6996450903 Mon Sep 17 00:00:00 2001 From: Robert Scholte Date: Sat, 3 Nov 2012 22:44:28 +0000 Subject: [PATCH] [MPLUGIN-232] java-basic-annotations IT for maven-plugin-plugin fails due to a missing description-tag in the plugin-help.xml git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1405437 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/resources/help-class-source.vm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/maven-plugin-tools-generators/src/main/resources/help-class-source.vm b/maven-plugin-tools-generators/src/main/resources/help-class-source.vm index 18da3a2..2ab4667 100644 --- a/maven-plugin-tools-generators/src/main/resources/help-class-source.vm +++ b/maven-plugin-tools-generators/src/main/resources/help-class-source.vm @@ -209,8 +209,7 @@ public class HelpMojo { throw new MojoExecutionException( "Multiple " + elementName + " in plugin-help.xml" ); } - Node node1 = namedChild.get( 0 ); - return node1; + return namedChild.get( 0 ); } private List findNamedChild( Node node, String elementName ) @@ -248,7 +247,7 @@ public class HelpMojo { String mojoGoal = getValue( mojo, "goal" ); Node configurationElement = findSingleChild( mojo, "configuration" ); - + Node description = findSingleChild( mojo, "description" ); if ( goal == null || goal.length() <= 0 || mojoGoal.equals( goal ) ) { append( sb, goalPrefix + ":" + mojoGoal, 0 ); @@ -256,15 +255,15 @@ public class HelpMojo if ( ( deprecated != null ) && isNotEmpty( deprecated.getNodeValue() ) ) { append( sb, "Deprecated. " + deprecated, 1 ); - if ( detail ) + if ( detail && description != null ) { append( sb, "", 0 ); - append( sb, getValue( mojo, "description" ), 1 ); + append( sb, description.getTextContent(), 1 ); } } - else + else if (description != null ) { - append( sb, getValue( mojo, "description" ), 1 ); + append( sb, description.getTextContent(), 1 ); } append( sb, "", 0 );