本文整理汇总了Java中org.jboss.shrinkwrap.api.GenericArchive类的典型用法代码示例。如果您正苦于以下问题:Java GenericArchive类的具体用法?Java GenericArchive怎么用?Java GenericArchive使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericArchive类属于org.jboss.shrinkwrap.api包,在下文中一共展示了GenericArchive类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class)
// Se agrega las dependencias
.addAsLibraries(Maven.resolver().loadPomFromFile("pom.xml")
.importRuntimeDependencies().resolve()
.withTransitivity().asFile())
// Se agregan los compilados de los paquetes de servicios
.addPackage(AgencyResource.class.getPackage())
// El archivo que contiene la configuracion a la base de datos.
.addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")
// El archivo beans.xml es necesario para injeccion de dependencias.
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/beans.xml"))
// El archivo shiro.ini es necesario para injeccion de dependencias
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/shiro.ini"))
// El archivo web.xml es necesario para el despliegue de los servlets
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory("src/main/webapp").as(GenericArchive.class), "/");
}
示例2: createDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class)
// Se agrega las dependencias
.addAsLibraries(Maven.resolver().loadPomFromFile("pom.xml")
.importRuntimeDependencies().resolve()
.withTransitivity().asFile())
// Se agregan los compilados de los paquetes de servicios
.addPackage(ProductResource.class.getPackage())
// El archivo que contiene la configuracion a la base de datos.
.addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")
// El archivo beans.xml es necesario para injeccion de dependencias.
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/beans.xml"))
// El archivo shiro.ini es necesario para injeccion de dependencias
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/shiro.ini"))
// El archivo web.xml es necesario para el despliegue de los servlets
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory("src/main/webapp").as(GenericArchive.class), "/");
}
示例3: createDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class)
// Se agrega las dependencias
.addAsLibraries(Maven.resolver().loadPomFromFile("pom.xml")
.importRuntimeDependencies().resolve()
.withTransitivity().asFile())
// Se agregan los compilados de los paquetes de servicios
.addPackage(ClientResource.class.getPackage())
// El archivo que contiene la configuracion a la base de datos.
.addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")
// El archivo beans.xml es necesario para injeccion de dependencias.
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/beans.xml"))
// El archivo shiro.ini es necesario para injeccion de dependencias
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/shiro.ini"))
// El archivo web.xml es necesario para el despliegue de los servlets
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory("src/main/webapp").as(GenericArchive.class), "/");
}
示例4: createDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class)
// Se agrega las dependencias
.addAsLibraries(Maven.resolver().loadPomFromFile("pom.xml")
.importRuntimeDependencies().resolve()
.withTransitivity().asFile())
// Se agregan los compilados de los paquetes de servicios
.addPackage(CategoryResource.class.getPackage())
// El archivo que contiene la configuracion a la base de datos.
.addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")
// El archivo beans.xml es necesario para injeccion de dependencias.
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/beans.xml"))
// El archivo shiro.ini es necesario para injeccion de dependencias
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/shiro.ini"))
// El archivo web.xml es necesario para el despliegue de los servlets
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory("src/main/webapp").as(GenericArchive.class), "/");
}
示例5: writeFaultSeqArchive
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
public GenericArchive writeFaultSeqArchive(Domain domain, List<Contingency> contingencies, Network network, EurostagDictionary dictionary, Function<Integer, String> seqFileNameFct) throws IOException {
if ((contingencies == null) || (contingencies.isEmpty())) {
throw new RuntimeException("contingencies list is empty, cannot write .seq scenario files");
}
GenericArchive archive = domain.getArchiveFactory().create(GenericArchive.class);
try (FileSystem fileSystem = ShrinkWrapFileSystems.newFileSystem(archive)) {
Path rootDir = fileSystem.getPath("/");
for (int i = 0; i < contingencies.size(); i++) {
Contingency contingency = contingencies.get(i);
Path seqFile = rootDir.resolve(seqFileNameFct.apply(i));
try (BufferedWriter writer = Files.newBufferedWriter(seqFile, StandardCharsets.UTF_8)) {
writeFaultSeq(writer, contingency, network, dictionary);
}
}
}
return archive;
}
示例6: createDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
@Deployment
public static Archive<?> createDeployment() {
GenericArchive qunitFiles = ShrinkWrap.create( GenericArchive.class )
.as( ExplodedImporter.class )
.importDirectory( "bower_components/js-cookie/" )
.as( GenericArchive.class );
WebArchive war = IntegrationUtils.createCommonDeployment()
.merge( qunitFiles, "/", Filters.includeAll() )
.addAsWebInfResource(
new File( "src/test/resources/web.xml" ),
"web.xml"
);
System.out.println( " ----- LOGGING THE FILES ADDED TO JBOSS" );
System.out.println( war.toString( true ) );
System.out.println( " ----- END OF LOGGING THE FILES ADDED TO JBOSS" );
return war;
}
示例7: createDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment()
{
final GenericArchive webResources = ShrinkWrap.create(GenericArchive.class)
.as(ExplodedImporter.class)
.importDirectory("src/main/webapp")
.as(GenericArchive.class);
final File[] seleniumApi = Maven.resolver()
.loadPomFromFile("pom.xml")
.resolve("org.seleniumhq.selenium:selenium-api:2.35.0")
.withTransitivity()
.asFile();
return ShrinkWrap.create(WebArchive.class, NoteResourceImplTest.class.getSimpleName() + ".war")
.addClasses(Note.class, NoteApp.class, NoteResource.class, NoteResourceImpl.class)
.addAsResource("META-INF/persistence.xml")
.addAsLibraries(seleniumApi)
.merge(webResources);
}
示例8: createSpecialtiesDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
public static WebArchive createSpecialtiesDeployment() {
File[] deps = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve().withTransitivity().asFile();
WebArchive war = null;
try {
war = ShrinkWrap.create(WebArchive.class, "specialties.war")
.addClasses(SpecialtyController.class, LanguageBean.class,
SpecialtyDao.class, SpecialtyDaoImpl.class,
Owner.class, Pet.class, PetType.class,
Specialty.class, Vet.class, Visit.class,
net.sourceforge.cobertura.coveragedata.LightClassmapListener.class)
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory(WEBAPP_SRC).as(GenericArchive.class),
"/", Filters.include(".*\\.xhtml$|.*\\.html$"))
.addAsResource("META-INF/persistence.xml")
.addAsResource("messages_de.properties")
.addAsResource("messages_en.properties")
.addAsLibraries(deps)
.addAsWebInfResource(
new StringAsset("<faces-config version=\"2.2\"/>"),
"faces-config.xml");
} catch (Exception e) {
e.printStackTrace();
}
return war;
}
示例9: createPetTypeDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
public static WebArchive createPetTypeDeployment() {
File[] deps = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve().withTransitivity().asFile();
return ShrinkWrap.create(WebArchive.class, "pettypes.war")
.addClasses(PetTypeController.class, LanguageBean.class,
PetTypeDao.class, PetTypeDaoImpl.class,
Owner.class, Pet.class, PetType.class,
Specialty.class, Vet.class, Visit.class,
net.sourceforge.cobertura.coveragedata.LightClassmapListener.class)
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory(WEBAPP_SRC).as(GenericArchive.class),
"/", Filters.include(".*\\.xhtml$|.*\\.html$"))
.addAsResource("META-INF/persistence.xml")
.addAsResource("messages_de.properties")
.addAsResource("messages_en.properties")
.addAsLibraries(deps)
.addAsWebInfResource(
new StringAsset("<faces-config version=\"2.2\"/>"),
"faces-config.xml");
}
示例10: createVetDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
public static WebArchive createVetDeployment() {
File[] deps = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve().withTransitivity().asFile();
return ShrinkWrap.create(WebArchive.class, "vet.war")
.addClasses(
SpecialtyController.class, VetController.class, LanguageBean.class,
SpecialtyConverter.class,
SpecialtyDao.class, SpecialtyDaoImpl.class,
VetDao.class, VetDaoImpl.class,
Owner.class, Pet.class, PetType.class,
Specialty.class, Vet.class, Visit.class,
VetSortingBean.class,
net.sourceforge.cobertura.coveragedata.LightClassmapListener.class)
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory(WEBAPP_SRC).as(GenericArchive.class),
"/", Filters.include(".*\\.xhtml$|.*\\.html$"))
.addAsResource("META-INF/persistence.xml")
.addAsResource("messages_de.properties")
.addAsResource("messages_en.properties")
.addAsLibraries(deps)
.addAsWebInfResource(
new StringAsset("<faces-config version=\"2.2\"/>"),
"faces-config.xml");
}
示例11: createSpecialtiesDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
public static WebArchive createSpecialtiesDeployment() {
File[] deps = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve().withTransitivity().asFile();
WebArchive war = null;
try {
war = ShrinkWrap.create(WebArchive.class, "specialties.war")
.addClasses(SpecialtyController.class, LanguageBean.class,
SpecialtyDao.class, SpecialtyDaoImpl.class,
Owner.class, Pet.class, PetType.class,
Specialty.class, Vet.class, Visit.class)
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory(WEBAPP_SRC).as(GenericArchive.class),
"/", Filters.include(".*\\.xhtml$|.*\\.html$"))
.addAsResource("META-INF/persistence.xml")
.addAsResource("messages_de.properties")
.addAsResource("messages_en.properties")
.addAsLibraries(deps)
.addAsWebInfResource(
new StringAsset("<faces-config version=\"2.0\"/>"),
"faces-config.xml");
} catch (Exception e) {
e.printStackTrace();
}
return war;
}
示例12: createPetTypeDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
public static WebArchive createPetTypeDeployment() {
File[] deps = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve().withTransitivity().asFile();
return ShrinkWrap.create(WebArchive.class, "pettypes.war")
.addClasses(PetTypeController.class, LanguageBean.class,
PetTypeDao.class, PetTypeDaoImpl.class,
Owner.class, Pet.class, PetType.class,
Specialty.class, Vet.class, Visit.class)
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory(WEBAPP_SRC).as(GenericArchive.class),
"/", Filters.include(".*\\.xhtml$|.*\\.html$"))
.addAsResource("META-INF/persistence.xml")
.addAsResource("messages_de.properties")
.addAsResource("messages_en.properties")
.addAsLibraries(deps)
.addAsWebInfResource(
new StringAsset("<faces-config version=\"2.0\"/>"),
"faces-config.xml");
}
示例13: createVetDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
public static WebArchive createVetDeployment() {
File[] deps = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve().withTransitivity().asFile();
return ShrinkWrap.create(WebArchive.class, "vet.war")
.addClasses(
SpecialtyController.class, VetController.class, LanguageBean.class,
SpecialtyConverter.class, SpecialtyParser.class,
SpecialtyDao.class, SpecialtyDaoImpl.class,
VetDao.class, VetDaoImpl.class,
Owner.class, Pet.class, PetType.class,
Specialty.class, Vet.class, Visit.class)
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory(WEBAPP_SRC).as(GenericArchive.class),
"/", Filters.include(".*\\.xhtml$|.*\\.html$"))
.addAsResource("META-INF/persistence.xml")
.addAsResource("messages_de.properties")
.addAsResource("messages_en.properties")
.addAsLibraries(deps)
.addAsWebInfResource(
new StringAsset("<faces-config version=\"2.0\"/>"),
"faces-config.xml");
}
示例14: createOwnerDeployment
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的package包/类
public static WebArchive createOwnerDeployment() {
File[] deps = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve().withTransitivity().asFile();
WebArchive war = null;
try {
war = ShrinkWrap.create(WebArchive.class, "owner.war")
.addClasses(OwnerController.class, PetTypeController.class, LanguageBean.class,
OwnerDao.class, OwnerDaoImpl.class, PetDao.class, PetDaoImpl.class,
VisitDao.class, VisitDaoImpl.class,
PetTypeDao.class, PetTypeDaoImpl.class,
Owner.class, Pet.class, PetType.class,
Specialty.class, Vet.class, Visit.class)
.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
.importDirectory(WEBAPP_SRC).as(GenericArchive.class),
"/", Filters.include(".*\\.xhtml$"))
.addAsResource("META-INF/persistence.xml")
.addAsResource("messages_de.properties")
.addAsResource("messages_en.properties")
.addAsLibraries(deps)
.addAsWebInfResource(
new StringAsset("<faces-config version=\"2.0\"/>"),
"faces-config.xml");
} catch (Exception e) {
e.printStackTrace();
}
return war;
}
示例15: createTestArchive2
import org.jboss.shrinkwrap.api.GenericArchive; //导入依赖的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;
}