I would initially try to get that working with one super-smart war. I don't know what problems you run into, exactly, but jboss-web.xml
and jetty-web.xml
should be able to coexist in one WEB-INF.
If reality isn't so generous, I would use the war overlays feature and version classifiers. Filesystem structure and pom.xml
s would be like this:
myproject (packaging: pom, version: 1.0.0-SNAPSHOT)
+-- myproject-war (packaging: war, version: 1.0.0-SNAPSHOT)
+-- myproject-war-jboss (packaging: war, version: 1.0.0-jboss-SNAPSHOT)
+-- myproject-war-jetty (packaging: war, version: 1.0.0-jetty-SNAPSHOT)
The two appserver-specific wars contain just the appserver-specific files and import the plain war as an overlay. Three different war's get deployed into your Maven repository, differing in version number only by the classifier part (e.g. myproject-war-1.0.0-jboss
).
Ideally, you'd get the versioning set up in pom.xml
with something like <version>${project.parent.version}-jboss</version>
, but I'm not entirely sure that can be combined with the SNAPSHOT classifier and still work.