in src/main/java/org/apache/maven/plugins/ear/GenerateApplicationXmlMojo.java [349:396]
private List<EnvEntry> buildEnvEntries()
throws EarPluginException
{
final List<EnvEntry> result = new ArrayList<EnvEntry>();
if ( envEntries == null )
{
return result;
}
try
{
StringSearchInterpolator ssi = new StringSearchInterpolator();
ValueSource vs = new MapBasedValueSource( project.getProperties() );
ssi.addValueSource( vs );
final PlexusConfiguration[] allEnvEntries = envEntries.getChildren( EnvEntry.ENV_ENTRY );
getLog().debug( "buildEnvEntries: allEnvEntries size:" + allEnvEntries.length );
for ( PlexusConfiguration envEntry : allEnvEntries )
{
final String childDescription =
interpolate( ssi, envEntry.getChild( EnvEntry.DESCRIPTION ).getValue() );
final String childEnvEntryName =
interpolate( ssi, envEntry.getChild( EnvEntry.ENV_ENTRY_NAME ).getValue() );
final String childEnvEntryType =
interpolate( ssi, envEntry.getChild( EnvEntry.ENV_ENTRY_TYPE ).getValue() );
final String childEnvEntryValue =
interpolate( ssi, envEntry.getChild( EnvEntry.ENV_ENTRY_VALUE ).getValue() );
final String childEnvLookupNameValue =
interpolate( ssi, envEntry.getChild( EnvEntry.ENV_LOOKUP_NAME ).getValue() );
try
{
result.add( new EnvEntry( childDescription, childEnvEntryName, childEnvEntryType,
childEnvEntryValue, childEnvLookupNameValue ) );
}
catch ( IllegalArgumentException e )
{
throw new EarPluginException( "Invalid env-entry [" + envEntry + "]", e );
}
}
return result;
}
catch ( InterpolationException e )
{
throw new EarPluginException( "Interpolation exception:", e );
}
}