409684 Ids and properties not set for execution of jetty xml config files with mvn plugin

This commit is contained in:
Jan Bartel 2013-06-03 12:34:37 +10:00
parent a2732e3cf6
commit d581dac287
1 changed files with 18 additions and 2 deletions

View File

@ -449,12 +449,28 @@ public abstract class AbstractJettyMojo extends AbstractMojo
{
if (getJettyXmlFiles() == null)
return;
XmlConfiguration last = null;
for ( File xmlFile : getJettyXmlFiles() )
{
getLog().info( "Configuring Jetty from xml configuration file = " + xmlFile.getCanonicalPath() );
XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(xmlFile));
xmlConfiguration.configure(this.server);
//chain ids from one config file to another
if (last == null)
xmlConfiguration.getIdMap().put("Server", this.server);
else
xmlConfiguration.getIdMap().putAll(last.getIdMap());
//Set the system properties each time in case the config file set a new one
Enumeration<?> ensysprop = System.getProperties().propertyNames();
while (ensysprop.hasMoreElements())
{
String name = (String)ensysprop.nextElement();
xmlConfiguration.getProperties().put(name,System.getProperty(name));
}
last = xmlConfiguration;
xmlConfiguration.configure();
}
}