Skip to content

Instantly share code, notes, and snippets.

Created April 7, 2011 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/908830 to your computer and use it in GitHub Desktop.
Save anonymous/908830 to your computer and use it in GitHub Desktop.
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