if (beansXml.exists())
archive.addAsWebInfResource(beansXml, "beans.xml");
File jettyEnv = new File("src/main/webapp/WEB-INF/jetty-env.xml");
if (jettyEnv.exists())
archive.addAsWebInfResource(jettyEnv);
MavenBuilderImpl libs = (MavenBuilderImpl) DependencyResolvers.use(MavenDependencyResolver.class)
.configureFrom("../settings/settings.xml")
.includeDependenciesFromPom("pom.xml")
.exclusion("org.jboss.weld.se:weld-se");
archive.addSources(new File("src/main/java")).
addSources(new File("target/generated-sources/gwt")).
addSources(new File("src/main/resources")).
addSources(new File("src/test/java")).
addSources(new File("src/test/resources")).
addAsLibraries(libs.resolveAs(JavaArchive.class));
return archive;
}