Author: bentmann Date: Sat Dec 18 00:29:22 2010 New Revision: 1050549 URL: http://svn.apache.org/viewvc?rev=1050549&view=rev Log: [MPH-81] maven-help-plugin:describe to display Required and Expression status Submitted by: Guo Du
o Applied with minor modifications Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java?rev=1050549&r1=1050548&r2=1050549&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 Sat Dec 18 00:29:22 2010 @@ -765,7 +765,7 @@ public class DescribeMojo String defaultVal = parameter.getDefaultValue(); if ( defaultVal == null ) { - // defaultVal is ALWAYS null, this is a bug in PluginDescriptorBuilder + // defaultVal is ALWAYS null, this is a bug in PluginDescriptorBuilder (cf. MNG-4941) defaultVal = md.getMojoConfiguration().getChild( parameter.getName() ).getAttribute( "default-value", null ); } @@ -780,7 +780,17 @@ public class DescribeMojo } append( buffer, parameter.getName() + defaultVal, 2 ); + if ( parameter.isRequired() ) + { + append( buffer, "Required", "true", 3 ); + } + String expression = parameter.getExpression(); + if ( StringUtils.isEmpty( expression ) ) + { + // expression is ALWAYS null, this is a bug in PluginDescriptorBuilder (cf. MNG-4941). + expression = md.getMojoConfiguration().getChild( parameter.getName() ).getValue( null ); + } if ( StringUtils.isNotEmpty( expression ) ) { append( buffer, "Expression", expression, 3 );