Allow to use a role-hint in parameter expression

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@293284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2005-10-03 09:45:43 +00:00
parent bea5e00e1e
commit cce67f6caa
1 changed files with 12 additions and 1 deletions

View File

@ -280,8 +280,19 @@ public class PluginDescriptorGenerator
// remove "component." plus expression delimiters
String role = expression.substring( "${component.".length(), expression.length() - 1 );
String roleHint = null;
int posRoleHintSeparator;
if ( ( posRoleHintSeparator = role.indexOf( "#" ) ) > 0 )
{
roleHint = role.substring( posRoleHintSeparator + 1 );
role = role.substring( 0, posRoleHintSeparator );
}
// TODO: remove deprecated expression
requirements.put( parameter.getName(), new Requirement( role ) );
requirements.put( parameter.getName(), new Requirement( role, roleHint ) );
}
else if ( parameter.getRequirement() != null )
{