public static WebArchive getDeploymentNoWebXml(String name)
{
if (isJetty() && "ROOT.war".equals(name))
name = ".war";
WebArchive archive = ShrinkWrap
.create(WebArchive.class, name)
.addPackages(true, MockBinding.class.getPackage())
.addAsLibraries(resolveDependencies("org.ocpsoft.logging:logging-api"))
.addAsLibraries(getRewriteArchive())
.addAsLibraries(getRewriteConfigArchive())
.addAsLibraries(getRewriteAnnotationsArchive())
.addAsLibraries(getContainerArchive())
.addAsLibraries(getCurrentArchive());
// Jetty specific stuff
if (isJetty()) {
/*
* Set the EL implementation
*/
archive.add(new StringAsset("com.sun.el.ExpressionFactoryImpl"),
"/WEB-INF/classes/META-INF/services/javax.el.ExpressionFactory");
/*
* Set up container configuration
*/
archive.addAsWebInfResource("jetty-env.xml", "jetty-env.xml");
archive.addAsWebInfResource("jetty-log4j.xml", "log4j.xml");
}
// Tomcat specific stuff
if (isTomcat()) {
// setup Weld
if (isWeld()) {
archive.addAsLibraries(resolveDependencies("org.jboss.weld:weld-core:1.1.9.Final"));
archive.addAsLibraries(resolveDependencies("org.jboss.weld.servlet:weld-servlet-core:1.1.9.Final"));
archive.addAsWebResource("tomcat-weld-context.xml", "META-INF/context.xml");
}
// setup OWB
if (isOWB()) {
archive.addAsLibraries(resolveDependencies("javax.enterprise:cdi-api:1.0-SP4"));
archive.addAsLibraries(resolveDependencies("org.apache.openwebbeans:openwebbeans-impl:1.1.5"));
archive.addAsLibraries(resolveDependencies("org.apache.openwebbeans:openwebbeans-web:1.1.5"));
archive.addAsLibraries(resolveDependencies("org.apache.openwebbeans:openwebbeans-spi:1.1.5"));
archive.addAsLibraries(resolveDependencies("org.apache.openwebbeans:openwebbeans-resource:1.1.5"));
archive.addAsWebResource("tomcat-owb-context.xml", "META-INF/context.xml");
}
// setup Mojarra
archive.addAsLibraries(resolveDependencies("org.glassfish:javax.faces:2.1.13"));
archive.addAsLibraries(resolveDependencies("javax.servlet:jstl:1.2"));
}
return archive;
}