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
|
@ -450,11 +450,27 @@ public abstract class AbstractJettyMojo extends AbstractMojo
|
||||||
if (getJettyXmlFiles() == null)
|
if (getJettyXmlFiles() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
XmlConfiguration last = null;
|
||||||
for ( File xmlFile : getJettyXmlFiles() )
|
for ( File xmlFile : getJettyXmlFiles() )
|
||||||
{
|
{
|
||||||
getLog().info( "Configuring Jetty from xml configuration file = " + xmlFile.getCanonicalPath() );
|
getLog().info( "Configuring Jetty from xml configuration file = " + xmlFile.getCanonicalPath() );
|
||||||
XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(xmlFile));
|
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