diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractJettyMojo.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractJettyMojo.java index 558899c1819..4e976f42118 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractJettyMojo.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractJettyMojo.java @@ -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(); } }