本文整理匯總了Java中org.jboss.shrinkwrap.api.spec.WebArchive.merge方法的典型用法代碼示例。如果您正苦於以下問題:Java WebArchive.merge方法的具體用法?Java WebArchive.merge怎麽用?Java WebArchive.merge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.shrinkwrap.api.spec.WebArchive
的用法示例。
在下文中一共展示了WebArchive.merge方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createTestArchive2
import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment(name = APP_NAME, order = 2, testable = false)
public static Archive<?> createTestArchive2() throws IOException {
WebArchive war = ShrinkWrap.create(WebArchive.class, "app-angular2.war")
.addAsWebResource(new StringAsset(createClient(ClientBuilder.create(APP_NAME)
.rootUrl(ROOT_URL)
.accessType(PUBLIC))), "keycloak.json");
war.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory(WEBAPP_SRC).as(GenericArchive.class),
"/",
Filters.includeAll());
return war;
}
示例2: createDeployment
import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment(testable = false)
public static WebArchive createDeployment() {
File[] extraJars = Maven.resolver().loadPomFromFile("pom.xml")
.resolve(
"org.projectlombok:lombok:1.16.8",
// "org.modelmapper:modelmapper:0.7.5",
// "org.apache.commons:commons-lang3:3.4",
// "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.6.3",
"io.jsonwebtoken:jjwt:0.8.0"
)
.withTransitivity()
.asFile();
final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
.addAsLibraries(extraJars)
.addPackages(true, Bootstrap.class.getPackage())
// .addAsResource("test-log4j.properties", "log4j.properties")
//Add JPA persistence configration.
//WARN: In a war package, persistence.xml should be put into /WEB-INF/classes/META-INF/, not /META-INF
//.addAsManifestResource("META-INF/test-persistence.xml", "persistence.xml")
.addAsResource("META-INF/persistence.xml")
.addAsResource("META-INF/orm.xml");
// .addAsWebInfResource("test-web.xml", "web.xml")
// // Enable CDI
// .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
// .addAsWebInfResource("test-jboss-deployment-structure.xml", "jboss-deployment-structure.xml");
war.merge(
ShrinkWrap.create(GenericArchive.class)
.as(ExplodedImporter.class)
.importDirectory("src/main/webapp")
.as(GenericArchive.class),
"/"
);
LOG.log(Level.INFO, "war to string @{0}", war.toString(true));
return war;
}