[MPLUGIN-215] don't generate content with empty value, due to default values defined for annotations

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1353251 13f79535-47bb-0310-9956-ffa450edef68
master
Herve Boutemy 2012-06-24 11:49:20 +00:00
parent 1c9a253347
commit c1e288aedd
1 changed files with 10 additions and 10 deletions

View File

@ -258,7 +258,7 @@ public class PluginDescriptorGenerator
// //
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
if ( mojoDescriptor.isDependencyResolutionRequired() != null ) if ( StringUtils.isNotEmpty( mojoDescriptor.isDependencyResolutionRequired() ) )
{ {
GeneratorUtils.element( w, "requiresDependencyResolution", mojoDescriptor.isDependencyResolutionRequired() ); GeneratorUtils.element( w, "requiresDependencyResolution", mojoDescriptor.isDependencyResolutionRequired() );
} }
@ -303,7 +303,7 @@ public class PluginDescriptorGenerator
// //
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
if ( mojoDescriptor.getPhase() != null ) if ( StringUtils.isNotEmpty( mojoDescriptor.getPhase() ) )
{ {
GeneratorUtils.element( w, "phase", mojoDescriptor.getPhase() ); GeneratorUtils.element( w, "phase", mojoDescriptor.getPhase() );
} }
@ -312,17 +312,17 @@ public class PluginDescriptorGenerator
// //
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
if ( mojoDescriptor.getExecutePhase() != null ) if ( StringUtils.isNotEmpty( mojoDescriptor.getExecutePhase() ) )
{ {
GeneratorUtils.element( w, "executePhase", mojoDescriptor.getExecutePhase() ); GeneratorUtils.element( w, "executePhase", mojoDescriptor.getExecutePhase() );
} }
if ( mojoDescriptor.getExecuteGoal() != null ) if ( StringUtils.isNotEmpty( mojoDescriptor.getExecuteGoal() ) )
{ {
GeneratorUtils.element( w, "executeGoal", mojoDescriptor.getExecuteGoal() ); GeneratorUtils.element( w, "executeGoal", mojoDescriptor.getExecuteGoal() );
} }
if ( mojoDescriptor.getExecuteLifecycle() != null ) if ( StringUtils.isNotEmpty( mojoDescriptor.getExecuteLifecycle() ) )
{ {
GeneratorUtils.element( w, "executeLifecycle", mojoDescriptor.getExecuteLifecycle() ); GeneratorUtils.element( w, "executeLifecycle", mojoDescriptor.getExecuteLifecycle() );
} }
@ -347,7 +347,7 @@ public class PluginDescriptorGenerator
// //
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
if ( mojoDescriptor.getComponentConfigurator() != null ) if ( StringUtils.isNotEmpty( mojoDescriptor.getComponentConfigurator() ) )
{ {
w.startElement( "configurator" ); w.startElement( "configurator" );
w.writeText( mojoDescriptor.getComponentConfigurator() ); w.writeText( mojoDescriptor.getComponentConfigurator() );
@ -358,7 +358,7 @@ public class PluginDescriptorGenerator
// //
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
if ( mojoDescriptor.getComponentComposer() != null ) if ( StringUtils.isNotEmpty( mojoDescriptor.getComponentComposer() ) )
{ {
w.startElement( "composer" ); w.startElement( "composer" );
w.writeText( mojoDescriptor.getComponentComposer() ); w.writeText( mojoDescriptor.getComponentComposer() );
@ -571,7 +571,7 @@ public class PluginDescriptorGenerator
w.startElement( parameter.getName() ); w.startElement( parameter.getName() );
String type = parameter.getType(); String type = parameter.getType();
if ( type != null ) if ( StringUtils.isNotEmpty( type ) )
{ {
w.addAttribute( "implementation", type ); w.addAttribute( "implementation", type );
} }
@ -581,7 +581,7 @@ public class PluginDescriptorGenerator
w.addAttribute( "default-value", parameter.getDefaultValue() ); w.addAttribute( "default-value", parameter.getDefaultValue() );
} }
if ( parameter.getExpression() != null ) if ( StringUtils.isNotEmpty( parameter.getExpression() ) )
{ {
w.writeText( parameter.getExpression() ); w.writeText( parameter.getExpression() );
} }
@ -609,7 +609,7 @@ public class PluginDescriptorGenerator
GeneratorUtils.element( w, "role", requirement.getRole() ); GeneratorUtils.element( w, "role", requirement.getRole() );
if ( requirement.getRoleHint() != null ) if ( StringUtils.isNotEmpty( requirement.getRoleHint() ) )
{ {
GeneratorUtils.element( w, "role-hint", requirement.getRoleHint() ); GeneratorUtils.element( w, "role-hint", requirement.getRoleHint() );
} }