Search code examples
jettyjboss-weldappserver

How do I create a jetty 6 and jetty 7 compatible jetty-web.xml file in the same war file?


In Jetty 6 I need to create a WEB-INF/jetty-web.xml file which contains this:

<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">

But in Jetty 7 I need the same exact file WEB-INF/jetty-web.xml to contain this:

<Configure id="webAppCtx" class="org.eclipse.jetty.webapp.WebAppContext">

Both files differ (org.mortbay vs org.eclipse). How do I create 1 war file which is compatible with both jetty 6 and jetty 7?


Solution

  • Poor man's solution: build 2 wars for Jetty.

    I am thinking about using maven assembly scripts to build multiple wars, However, I need to completely duplicate the jetty-web.xml file for both versions in my sources.