Created
April 7, 2011 21:53
-
-
Save anonymous/908830 to your computer and use it in GitHub Desktop.
Auto weld-servlet vesion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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