Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Auto weld-servlet vesion
String WELD_VERSION = org.jboss.weld.servlet.WeldListener.class.getPackage().getSpecificationVersion();
if( WELD_VERSION == null )
WELD_VERSION = "1.1.0.Final";
log.fine(" Using weld-servlet version: " + WELD_VERSION);
WebArchive war = ShrinkWrap.create(WebArchive.class, "test2.war")
.addClasses(TestServlet.class, TestBean.class)
.addAsLibraries(
DependencyResolvers.use(MavenDependencyResolver.class)
.artifact("org.jboss.weld.servlet:weld-servlet:" + WELD_VERSION).resolveAs(GenericArchive.class))
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsManifestResource("in-container-context.xml", "context.xml")
.setWebXML("in-container-web.xml");
/// DEBUG - see what's
war.as(ZipExporter.class).exportTo( new File("/tmp/arq.zip"), true );
return war;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.