diff --git a/maven-plugin-plugin/src/it/help-basic/expected-help.txt b/maven-plugin-plugin/src/it/help-basic/expected-help.txt index de82804..09240af 100644 --- a/maven-plugin-plugin/src/it/help-basic/expected-help.txt +++ b/maven-plugin-plugin/src/it/help-basic/expected-help.txt @@ -8,13 +8,16 @@ help:test Available parameters: - defaultParam + defaultParam (Default: escape\backslash) This parameter uses 'quotation' marks and backslashes '\\' in its description. Those characters must be escaped in Java string literals. deprecatedParam + Deprecated. As of version 1.0, use the {@link #defaultParam} instead. + This parameter is deprecated. undocumentedParam Required: Yes + User property: test.undocumented 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 ba2a673..2a2765e 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 @@ -38,7 +38,6 @@ import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; /** @@ -319,18 +318,18 @@ public class HelpMojo String parameterName = getValue( parameter, "name" ); String parameterDescription = getValue( parameter, "description" ); - Node fieldConfigurationElement = findSingleChild( configurationElement, parameterName ); + Element fieldConfigurationElement = (Element)findSingleChild( configurationElement, parameterName ); String parameterDefaultValue = ""; - if ( fieldConfigurationElement != null && fieldConfigurationElement.getNodeValue() != null ) + if ( fieldConfigurationElement != null && fieldConfigurationElement.hasAttribute( "default-value" ) ) { - parameterDefaultValue = " (Default: " + ((Element)fieldConfigurationElement).getAttribute( "default-value" ) + ")"; + parameterDefaultValue = " (Default: " + fieldConfigurationElement.getAttribute( "default-value" ) + ")"; } append( sb, parameterName + parameterDefaultValue, 2 ); Node deprecated = findSingleChild( parameter, "deprecated" ); - if ( ( deprecated != null ) && isNotEmpty( deprecated.getNodeValue() ) ) + if ( ( deprecated != null ) && isNotEmpty( deprecated.getTextContent() ) ) { - append( sb, "Deprecated. " + deprecated.getNodeValue(), 3 ); + append( sb, "Deprecated. " + deprecated.getTextContent(), 3 ); append( sb, "", 0 ); } append( sb, parameterDescription, 3 ); @@ -338,10 +337,9 @@ public class HelpMojo { append( sb, "Required: Yes", 3 ); } - Node expression = findSingleChild( parameter, "expression" ); - if ( ( expression != null ) && isNotEmpty( expression.getNodeValue() ) ) + if ( ( fieldConfigurationElement != null ) && isNotEmpty( fieldConfigurationElement.getTextContent() ) ) { - String property = getPropertyFromExpression( expression.getNodeValue() ); + String property = getPropertyFromExpression( fieldConfigurationElement.getTextContent() ); append( sb, "User property: " + property, 3 ); }