[MNG-4997] Plugin @Parameter alias does not work for complex parameter types

o Strengthened IT


git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@1070148 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2011-02-12 20:31:55 +00:00
parent cb6508601c
commit f4e7fc35d6
3 changed files with 17 additions and 2 deletions

View File

@ -26,7 +26,8 @@ import java.io.File;
import java.util.Properties;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-674">MNG-674</a>.
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-674">MNG-674</a> and
* <a href="http://jira.codehaus.org/browse/MNG-4997">MNG-4997</a>.
*
* @author John Casey
* @version $Id$
@ -37,7 +38,7 @@ public class MavenITmng0674PluginParameterAliasTest
public MavenITmng0674PluginParameterAliasTest()
{
super( ALL_MAVEN_VERSIONS );
super( "[3.0,)" );
}
/**
@ -59,6 +60,7 @@ public class MavenITmng0674PluginParameterAliasTest
Properties props = verifier.loadProperties( "target/config.properties" );
assertEquals( "MNG-674-1", props.getProperty( "aliasParam" ) );
assertEquals( "MNG-674-2", props.getProperty( "aliasDefaultExpressionParam" ) );
assertEquals( "MNG-4997", props.getProperty( "aliasStringParams.0" ) );
}
/**
@ -80,6 +82,7 @@ public class MavenITmng0674PluginParameterAliasTest
Properties props = verifier.loadProperties( "target/config.properties" );
assertEquals( "MNG-674-1", props.getProperty( "aliasParam" ) );
assertEquals( "MNG-674-2", props.getProperty( "aliasDefaultExpressionParam" ) );
assertEquals( "MNG-4997", props.getProperty( "aliasStringParams.0" ) );
}
}

View File

@ -20,6 +20,10 @@
<aliasParamLegacy>MNG-674-1</aliasParamLegacy>
<!-- parameter that has a default value -->
<fullyAnnotatedParam>MNG-674-2</fullyAnnotatedParam>
<!-- parameter that is complex (cf. MNG-4997) -->
<aliasStringParamsLegacy>
<item>MNG-4997</item>
</aliasStringParamsLegacy>
</configuration>
<executions>
<execution>

View File

@ -235,6 +235,13 @@ public class ConfigMojo
*/
private Properties propertiesParam;
/**
* A complex parameter with an alias.
*
* @parameter alias="aliasStringParamsLegacy"
*/
private String[] aliasStringParams;
/**
* A complex parameter of type {@link org.apache.maven.plugin.coreit.Bean}.
*
@ -323,6 +330,7 @@ public class ConfigMojo
PropertiesUtil.serialize( props, "setParam", setParam );
PropertiesUtil.serialize( props, "mapParam", mapParam );
PropertiesUtil.serialize( props, "propertiesParam", propertiesParam );
PropertiesUtil.serialize( props, "aliasStringParams", aliasStringParams );
PropertiesUtil.serialize( props, "domParam", domParam );
if ( beanParam != null )
{