本文整理汇总了Java中org.jboss.shrinkwrap.api.spec.EnterpriseArchive.addAsManifestResource方法的典型用法代码示例。如果您正苦于以下问题:Java EnterpriseArchive.addAsManifestResource方法的具体用法?Java EnterpriseArchive.addAsManifestResource怎么用?Java EnterpriseArchive.addAsManifestResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.shrinkwrap.api.spec.EnterpriseArchive
的用法示例。
在下文中一共展示了EnterpriseArchive.addAsManifestResource方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setJBossDeploymentStructureXml
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
/**
* This method sets a new JBoss deployment structure for an enterprise
* archive.
*
* @param enterpriseArchive
* is the {@link EnterpriseArchive} to be edited.
* @param jbossDeploymentStructure
* is the content of the new deployment structure.
* @throws IOException
* No application.xml found
*/
public static void setJBossDeploymentStructureXml(
EnterpriseArchive enterpriseArchive, String jbossDeploymentStructure)
throws IOException {
File tempFile = File.createTempFile(
JBOSS_DEPLOYMENT_STRUCTURE_XML_FILE_NAME, ".temp");
tempFile.deleteOnExit();
IOUtils.write(jbossDeploymentStructure, new FileOutputStream(tempFile));
// delete the old descriptor
enterpriseArchive.delete(JBOSS_DEPLOYMENT_STRUCTURE_XML_PATH);
// set the new descriptor
enterpriseArchive.addAsManifestResource(tempFile,
JBOSS_DEPLOYMENT_STRUCTURE_XML_FILE_NAME);
}
示例2: deployWarInsideEar
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment(order = 4, name = "war-inside-ear")
public static Archive<?> deployWarInsideEar() throws Exception {
WebArchive warLib = ShrinkWrap.create(WebArchive.class, "bootstrap.war");
warLib.addClasses(DatabaseBootstrapWarTester.class);
warLib.addClasses(HibernateTestUtil.class);
warLib.addClasses(BootstrapDatabaseITCase.class);
warLib.addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
warLib.addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("classes/META-INF/beans.xml"));
warLib.addAsWebInfResource(new StringAsset(hibernate_cfg_xml), "classes/META-INF/hibernate.cfg.xml");
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + "-war-inside-ear.ear");
ear.addAsManifestResource(new StringAsset(generateEarDeploymentStructure("bootstrap.war")), "jboss-deployment-structure.xml");
ear.addAsModule(warLib);
return ear;
}
示例3: addToEarManifestIfExists
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
public static void addToEarManifestIfExists(EnterpriseArchive archive, String resource)
{
URL url = TestDeployment.class.getClassLoader().getResource(resource);
if (url != null) {
archive.addAsManifestResource(resource);
}
}
示例4: getEarDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
protected static EnterpriseArchive getEarDeployment(String applicationXml, String gaeApplicationXml, WebArchive... wars) {
EnterpriseArchive ear = toEarDeployment(wars);
ear.addAsManifestResource(applicationXml, "application.xml");
ear.addAsResource(gaeApplicationXml, "appengine-application.xml");
return ear;
}