409684 Ids and properties not set for execution of jetty xml config files with mvn plugin
This commit is contained in:
parent
a2732e3cf6
commit
d581dac287
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue