• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PomEquippedResolveStage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage的典型用法代码示例。如果您正苦于以下问题:Java PomEquippedResolveStage类的具体用法?Java PomEquippedResolveStage怎么用?Java PomEquippedResolveStage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PomEquippedResolveStage类属于org.jboss.shrinkwrap.resolver.api.maven包,在下文中一共展示了PomEquippedResolveStage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive deployment() {
  PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");

  String[] libraries = new String[]{"de.undercouch:actson", "commons-io:commons-io"};

  return ShrinkWrap.create(WebArchive.class)
    .addPackage(SingleItemPublisher.class.getPackage())
    .addPackage(Customer.class.getPackage())
    .addPackage(JsonConverter.class.getPackage())
    .addPackage(PublisherMessageBodyReader.class.getPackage())
    .addAsLibraries(pom.resolve(libraries).withTransitivity().asFile())
    .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
      .addDefaultNamespaces()
      .version("3.1")
      .exportAsString()));
}
 
开发者ID:openknowledge,项目名称:reactive-jax-rs,代码行数:18,代码来源:CustomerBatchUploadTest.java


示例2: create

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive create()
{
    final PomEquippedResolveStage configureResolverViaPlugin = Maven.configureResolverViaPlugin();
    final File warFile = configureResolverViaPlugin.resolve("org.alfresco:alfresco:war:?").withoutTransitivity().asSingleFile();
    final File[] libraries = configureResolverViaPlugin
            .resolve(Arrays.asList("org.alfresco:alfresco-repository:jar:h2scripts:?", "com.h2database:h2:jar:?",
                    "de.acosix.alfresco.utility:de.acosix.alfresco.utility.common:jar:?",
                    "de.acosix.alfresco.utility:de.acosix.alfresco.utility.repo:jar:installable:?"))
            .withoutTransitivity().asFile();
    final WebArchive archive = ShrinkWrap.createFromZipFile(WebArchive.class, warFile);
    archive.addAsLibraries(libraries);

    archive.addAsLibrary("installable-de.acosix.alfresco.mtsupport.repo.jar");

    archive.addAsResource("configRoot/alfresco-global.properties", "alfresco-global.properties");
    archive.addAsResource("configRoot/log4j.properties", "log4j.properties");
    archive.addAsResource("configRoot/alfresco/extension/dev-log4j.properties", "alfresco/extension/dev-log4j.properties");
    archive.addAsResource("configRoot/alfresco/extension/subsystems/Authentication/mt-ldap/test/custom.properties",
            "alfresco/extension/subsystems/Authentication/mt-ldap/test/custom.properties");
    archive.addAsResource("configRoot/alfresco/extension/subsystems/Synchronization/default/default/custom.properties",
            "alfresco/extension/subsystems/Synchronization/default/default/custom.properties");
    return archive;
}
 
开发者ID:Acosix,项目名称:alfresco-mt-support,代码行数:25,代码来源:AuthenticationAndSynchronisationTests.java


示例3: resolveEjbs

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
private static Archive<?>[] resolveEjbs(PomEquippedResolveStage dependencies) {
   	List<Archive<?>> archives = new ArrayList<Archive<?>>();

   	MavenResolvedArtifact[] artifacts = dependencies.resolve().withTransitivity().asResolvedArtifact();

	for (MavenResolvedArtifact artifact : artifacts) {
		if (PackagingType.EJB.equals(artifact.getCoordinate().getType())) {
			String originalName = artifact.asFile().getName();
			String name = originalName.replace(".ejb", ".jar");
			JavaArchive ejbArchive = ShrinkWrap.createFromZipFile(JavaArchive.class, artifact.asFile());
			archives.add(ShrinkWrap.create(JavaArchive.class, name).merge(ejbArchive));
		} else {
			archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, artifact.asFile()));
		}
	}
   	
   	return archives.toArray(new Archive<?>[archives.size()]);
}
 
开发者ID:Blazebit,项目名称:blaze-storage,代码行数:19,代码来源:AbstractContainerTest.java


示例4: base

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
static WebArchive base(String warName) {
    PomEquippedResolveStage resolver = Maven.resolver().loadPomFromFile("pom.xml");
    return ShrinkWrap
            .create(WebArchive.class, warName + ".war")
            .addClasses(FRAMEWORK_CLASSES)
            .addAsLibraries(resolver.resolve("com.vaadin:vaadin-server:7.1.6").withoutTransitivity().asSingleFile())
            .addAsLibraries(resolver.resolve("com.vaadin:vaadin-shared:7.1.6").withoutTransitivity().asSingleFile())
            .addAsWebInfResource(new ByteArrayAsset(VaadinExtension.class.getName().getBytes()),
                    ArchivePaths.create("services/javax.enterprise.inject.spi.Extension"))
            .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));

    /*-
    MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class).loadMetadataFromPom(
            "pom.xml");
           
    return ShrinkWrap
            .create(WebArchive.class, warName + ".war")
            .addClasses(FRAMEWORK_CLASSES)
            .addAsLibraries(resolver.artifact("com.vaadin:vaadin-server:7.1.6").resolveAsFiles())
           .addAsLibraries(resolver.artifact("com.vaadin:vaadin-shared:7.1.6").resolveAsFiles())
            .addAsWebInfResource(new ByteArrayAsset(VaadinExtension.class.getName().getBytes()),
                    ArchivePaths.create("services/javax.enterprise.inject.spi.Extension"))
            .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
     */

}
 
开发者ID:antoniomaria,项目名称:gazpachoquest,代码行数:27,代码来源:ArchiveProvider.java


示例5: buildArchive

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
public static WebArchive buildArchive(String clazz) {
    WebArchive war = ArquillianJUnitTransformer.createWar();
    ArquillianJUnitTransformer.addClasses(war, clazz, ExampleJUnitTransformer.class.getClassLoader());

    // Your test suite is most likely built separately from the TCK.  You would include all the
    // dependencies in the pom.xml, and then declare the packages and classes here.
    war.addPackage("com.google.appengine.sometests");

    // Include this even though you may not have an appengine-web.xml for your tests.
    war.addAsWebInfResource("appengine-web.xml");

    final PomEquippedResolveStage resolver = getResolver("pom.xml");

    // Necessary to run under App Engine.
    war.addAsLibraries(resolve(resolver, "com.google.appengine:appengine-api-1.0-sdk"));

    // GAE testing lib
    war.addAsLibraries(resolve(resolver, "com.google.appengine:appengine-testing"));

    // TCK Internals necessary for any tests to run under the TCK.
    war.addAsLibraries(resolve(resolver, "com.google.appengine.tck:appengine-tck-transformers")); // cleanup dep
    war.addAsLibraries(resolve(resolver, "com.google.appengine.tck:appengine-tck-base")); // lifecycle dep

    return war;
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:26,代码来源:ExampleJUnitTransformer.java


示例6: deployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive deployment() {
  PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
  return ShrinkWrap.create(WebArchive.class)
    .addPackage(SingleItemPublisher.class.getPackage())
    .addPackage(Customer.class.getPackage())
    .addAsLibraries(pom.resolve("commons-io:commons-io").withTransitivity().asFile())
    .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
      .addDefaultNamespaces()
      .version("3.1")
      .exportAsString()));
}
 
开发者ID:openknowledge,项目名称:reactive-jax-rs,代码行数:13,代码来源:CustomerTest.java


示例7: getDeployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static Archive<?> getDeployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class);
    war.addPackage(EntityToModelMapper.class.getPackage());
    war.addClasses(GaeSearchRepository.class, SearchData.class, SearchConfiguration.class);
    war.addAsWebInfResource("appengine-web.xml");
    war.addAsResource("datastore-indexes.xml");

    PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
    war.addAsLibraries(pom.resolve("com.google.appengine:appengine-api-1.0-sdk").withTransitivity().as(File.class));
    war.addAsLibraries(pom.resolve("me.snowdrop.data:spring-data-snowdrop-core").withTransitivity().as(File.class));

    return war;
}
 
开发者ID:snowdrop,项目名称:spring-data-snowdrop,代码行数:15,代码来源:SearchTest.java


示例8: resolveJar

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
static File[] resolveJar() {
  PomEquippedResolveStage pom = Maven.configureResolver()
                                    .workOffline()
                                    .withMavenCentralRepo(false)
                                    .withClassPathResolution(true)
                                    .loadPomFromFile("pom.xml");
  return pom.resolve(Helpers.SHADED_JAR).withTransitivity().asFile();
}
 
开发者ID:AmadeusITGroup,项目名称:HttpSessionReplacer,代码行数:9,代码来源:Helpers.java


示例9: deployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive deployment() {
  PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
  return ShrinkWrap.create(WebArchive.class)
      .addClasses(SampleApplication.class, VersionedMediaTypeAddressResource.class)
      .addPackage(AddressV1.class.getPackage())
      .addPackage(MovedFrom.class.getPackage())
      .addPackage(MessageBodyConverter.class.getPackage())
      .addAsLibraries(pom.resolve("org.apache.commons:commons-lang3").withTransitivity().asFile())
      .addAsLibraries(pom.resolve("org.json:json").withTransitivity().asFile())
      .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
        .addDefaultNamespaces()
        .version("3.0")
        .exportAsString()));
}
 
开发者ID:openknowledge,项目名称:jaxrs-versioning,代码行数:16,代码来源:VersionedMediaTypeFeatureTest.java


示例10: deployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive deployment() {
  PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
  return ShrinkWrap.create(WebArchive.class)
      .addClasses(SampleApplication.class, AddressResource.class)
      .addPackage(AddressV1.class.getPackage())
      .addPackage(MovedFrom.class.getPackage())
      .addPackage(MessageBodyConverter.class.getPackage())
      .addAsLibraries(pom.resolve("org.apache.commons:commons-lang3").withTransitivity().asFile())
      .addAsLibraries(pom.resolve("org.json:json").withTransitivity().asFile())
      .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
        .addDefaultNamespaces()
        .version("3.0")
        .exportAsString()));
}
 
开发者ID:openknowledge,项目名称:jaxrs-versioning,代码行数:16,代码来源:AddressResourceTest.java


示例11: deployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive deployment() {
  PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
  return ShrinkWrap.create(WebArchive.class)
      .addClasses(SampleApplication.class, VersionQueryParameterAddressResource.class)
      .addPackage(AddressV1.class.getPackage())
      .addPackage(MovedFrom.class.getPackage())
      .addPackage(MessageBodyConverter.class.getPackage())
      .addAsLibraries(pom.resolve("org.apache.commons:commons-lang3").withTransitivity().asFile())
      .addAsLibraries(pom.resolve("org.json:json").withTransitivity().asFile())
      .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
        .addDefaultNamespaces()
        .version("3.0")
        .exportAsString()));
}
 
开发者ID:openknowledge,项目名称:jaxrs-versioning,代码行数:16,代码来源:VersionQueryParameterFeatureTest.java


示例12: deployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive deployment() {
  PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
  return ShrinkWrap.create(WebArchive.class)
      .addClasses(SampleApplication.class, VersionMediaTypeParameterAddressResource.class)
      .addPackage(AddressV1.class.getPackage())
      .addPackage(MovedFrom.class.getPackage())
      .addPackage(MessageBodyConverter.class.getPackage())
      .addAsLibraries(pom.resolve("org.apache.commons:commons-lang3").withTransitivity().asFile())
      .addAsLibraries(pom.resolve("org.json:json").withTransitivity().asFile())
      .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
        .addDefaultNamespaces()
        .version("3.0")
        .exportAsString()));
}
 
开发者ID:openknowledge,项目名称:jaxrs-versioning,代码行数:16,代码来源:VersionMediaTypeParameterFeatureTest.java


示例13: deployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive deployment() {
  PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
  return ShrinkWrap.create(WebArchive.class)
      .addClasses(SampleApplication.class, VersionHeaderAddressResource.class)
      .addPackage(AddressV1.class.getPackage())
      .addPackage(MovedFrom.class.getPackage())
      .addPackage(MessageBodyConverter.class.getPackage())
      .addAsLibraries(pom.resolve("org.apache.commons:commons-lang3").withTransitivity().asFile())
      .addAsLibraries(pom.resolve("org.json:json").withTransitivity().asFile())
      .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
        .addDefaultNamespaces()
        .version("3.0")
        .exportAsString()));
}
 
开发者ID:openknowledge,项目名称:jaxrs-versioning,代码行数:16,代码来源:VersionHeaderFeatureTest.java


示例14: createBaseDeployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
protected static WebArchive createBaseDeployment() {
 	boolean offline = true;
 	PomEquippedResolveStage resolver = Maven.configureResolver().workOffline(offline).loadPomFromFile("pom.xml");
 	
 	return ShrinkWrap.create(WebArchive.class)
.addAsWebInfResource("test-jboss-deployment-structure.xml", "jboss-deployment-structure.xml")
.addAsWebInfResource("META-INF/beans.xml", "beans.xml")

/* persistence */
.addAsWebInfResource("test-ds.xml")
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsLibraries(resolveEjbs(resolver.importDependencies(ScopeType.TEST, ScopeType.COMPILE, ScopeType.RUNTIME)))
;
 }
 
开发者ID:Blazebit,项目名称:blaze-storage,代码行数:15,代码来源:AbstractContainerTest.java


示例15: buildArchive

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
public static WebArchive buildArchive(String clazz) {
    WebArchive war = createWar();
    addClasses(war, clazz, AppEngineDataNucleusTransformer.class.getClassLoader());

    war.addPackage("com.google.appengine.datanucleus");

    war.addClass("com.google.appengine.datanucleus.jpa.JPATestCase$EntityManagerFactoryName");
    war.addClass("com.google.appengine.datanucleus.jdo.JDOTestCase$PersistenceManagerFactoryName");

    war.addPackage("com.google.appengine.datanucleus.query");

    war.addPackage("com.google.appengine.datanucleus.test.jdo");
    war.addPackage("com.google.appengine.datanucleus.test.jpa");

    war.setWebXML(new org.jboss.shrinkwrap.api.asset.StringAsset("<web/>"));
    war.addAsWebInfResource("appengine-web.xml");
    war.addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
    war.addAsWebInfResource("META-INF/jdoconfig.xml", "classes/META-INF/jdoconfig.xml");
    war.addAsResource(new StringAsset("ignore.logging=true\n"), "capedwarf-compatibility.properties");

    final PomEquippedResolveStage resolver = getResolver("pom.xml");
    // GAE DN libs
    war.addAsLibraries(resolve(resolver, "com.google.appengine.orm:datanucleus-appengine"));
    war.addAsLibraries(resolve(resolver, "com.google.appengine:appengine-api-1.0-sdk"));
    war.addAsLibraries(resolve(resolver, "com.google.appengine:appengine-testing"));
    war.addAsLibraries(resolve(resolver, "com.google.appengine:appengine-api-stubs"));
    war.addAsLibraries(resolve(resolver, "org.datanucleus:datanucleus-core"));
    war.addAsLibraries(resolve(resolver, "org.datanucleus:datanucleus-api-jdo"));
    war.addAsLibraries(resolve(resolver, "org.datanucleus:datanucleus-api-jpa"));
    war.addAsLibraries(resolve(resolver, "javax.jdo:jdo-api"));
    war.addAsLibraries(resolve(resolver, "org.apache.geronimo.specs:geronimo-jpa_2.0_spec"));
    war.addAsLibraries(resolve(resolver, "org.easymock:easymock"));
    war.addAsLibraries(resolve(resolver, "org.easymock:easymockclassextension"));
    // TCK Internals
    war.addAsLibraries(resolve(resolver, "com.google.appengine.tck:appengine-tck-transformers")); // cleanup dep
    war.addAsLibraries(resolve(resolver, "com.google.appengine.tck:appengine-tck-base")); // lifecycle dep

    return war;
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:40,代码来源:AppEngineDataNucleusTransformer.java


示例16: addRuntimeSpecificLibraries

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Override
protected void addRuntimeSpecificLibraries(WebArchive wa, PomEquippedResolveStage resolver) {
  // inject rest easy version to differentiate between resteasy and wildfly-compatibility profile
  String restEasyVersion = System.getProperty("restEasyVersion");

  wa.addAsLibraries(resolver.addDependencies(
    MavenDependencies.createDependency("org.jboss.resteasy:resteasy-jaxrs:" + restEasyVersion, ScopeType.TEST, false,
      MavenDependencies.createExclusion("org.apache.httpcomponents:httpclient"))).resolve()
    .withTransitivity().asFile());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:11,代码来源:ResteasyTomcatServerBootstrap.java


示例17: create

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Override
public DeclaredDependencies create(FileSystemLayout ignored, ShrinkwrapArtifactResolvingHelper resolvingHelper) {
    final DeclaredDependencies declaredDependencies = new DeclaredDependencies();

    final PomEquippedResolveStage pom = MavenProfileLoader.loadPom(resolvingHelper.getResolver());

    // NonTransitiveStrategy
    final MavenResolvedArtifact[] explicitDeps =
            resolvingHelper.withResolver(r -> pom
                    .importRuntimeAndTestDependencies()
                    .resolve()
                    .withoutTransitivity()
                    .asResolvedArtifact()
            );

    // TransitiveStrategy
    for (MavenResolvedArtifact directDep : explicitDeps) {

        ArtifactSpec parent = new ArtifactSpec(
                directDep.getScope().toString(),
                directDep.getCoordinate().getGroupId(),
                directDep.getCoordinate().getArtifactId(),
                directDep.getCoordinate().getVersion(),
                directDep.getCoordinate().getPackaging().toString(),
                directDep.getCoordinate().getClassifier(),
                directDep.asFile()
        );
        MavenResolvedArtifact[] bucket =
                resolvingHelper.withResolver(r -> {
                                                 r.addDependency(resolvingHelper.createMavenDependency(parent));
                                                 return pom
                                                         .resolve()
                                                         .withTransitivity()
                                                         .asResolvedArtifact();
                                             }
                );

        for (MavenResolvedArtifact dep : bucket) {

            ArtifactSpec child = new ArtifactSpec(
                    dep.getScope().toString(),
                    dep.getCoordinate().getGroupId(),
                    dep.getCoordinate().getArtifactId(),
                    dep.getCoordinate().getVersion(),
                    dep.getCoordinate().getPackaging().toString(),
                    dep.getCoordinate().getClassifier(),
                    dep.asFile()
            );

            declaredDependencies.add(
                    parent,
                    child
            );
        }
    }

    return declaredDependencies;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:59,代码来源:MavenDependencyDeclarationFactory.java


示例18: loadPom

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
public static PomEquippedResolveStage loadPom(ConfigurableMavenResolverSystem resolver) {
    return resolver.loadPomFromFile(FileSystemLayout.resolveMavenBuildFileName(), determineProfiles());
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:4,代码来源:MavenProfileLoader.java


示例19: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
    File[] libs = pom.resolve(
        "ch.qos.logback:logback-classic").withTransitivity().asFile();

    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
        .version(WebAppVersionType._3_0)
        .createContextParam()
            .paramName("liquibase.changelog")
            .paramValue("src/test/resources/db.changelog.xml").up()
        .createContextParam()
            .paramName("liquibase.datasource")
            .paramValue("shiro").up()
        .createContextParam()
            .paramName("liquibase.onerror.fail")
            .paramValue("true").up()
        .createListener()
            .listenerClass(ContextListener.class.getName()).up()
        .createListener()
            .listenerClass(LiquibaseServletListener.class.getName()).up()
        .createListener()
            .listenerClass(EnvironmentLoaderListener.class.getName()).up()
        .createContextParam()
            .paramName("javax.ws.rs.Application")
            .paramValue(Activator.class.getName()).up()
        .createFilter()
            .filterName("ShiroFilter")
            .filterClass(ShiroFilter.class.getName()).up()
        .createFilterMapping()
            .filterName("ShiroFilter")
            .urlPattern("/*").up()
        .createFilter()
            .filterName("Resteasy")
            .filterClass(FilterDispatcher.class.getName()).up()
        .createFilterMapping()
            .filterName("Resteasy")
            .urlPattern("/*").up()
        .createResourceEnvRef()
            .resourceEnvRefName("BeanManager")
            .resourceEnvRefType(BeanManager.class.getName()).up()
        .createErrorPage()
            .exceptionType("java.lang.Exception")
            .location("/error.jsp").up()
        .createErrorPage()
            .errorCode(400)
            .location("/error.jsp").up()
        .createErrorPage()
            .errorCode(401)
            .location("/error.jsp").up()
        .createErrorPage()
            .errorCode(403)
            .location("/error.jsp").up()
        .createErrorPage()
            .errorCode(404)
            .location("/error.jsp").up()
        .createErrorPage()
            .errorCode(500)
            .location("/error.jsp").up();

    WebArchive war = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
        .setWebXML(new StringAsset(descriptor.exportAsString()))
        .addAsLibraries(libs)
        .addPackages(true, "me.buom.shiro")
        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
        .addAsWebInfResource(new File("src/test/resources/jetty-env.xml"), "jetty-env.xml")
        .addAsManifestResource(new File("src/test/resources/META-INF/aop.xml"), "aop.xml")
        .addAsWebResource(new File("src/test/resources/error.jsp"), "error.jsp");

    //System.out.println(descriptor.exportAsString());
    //System.out.println(war.toString(true));
    return war;
}
 
开发者ID:buom,项目名称:shiro-hmac,代码行数:74,代码来源:AppTest.java


示例20: build

import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; //导入依赖的package包/类
public WebArchive build(JavaArchive... archives) {
	if(LOGGER.isDebugEnabled() &&
		Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.setup"))) {
		LOGGER.debug("Creating testing web application archive:");
		LOGGER.debug("- Maven configuration:");
		LOGGER.debug("  + Setting: "+getSettings());
		LOGGER.debug("  + POM....: "+getPom());
		LOGGER.debug("- Web application configuration:");
		LOGGER.debug("  + Descriptor.....: "+getWebXml());
		LOGGER.debug("  + Deployable name: "+getDeployableName());
		LOGGER.debug("  + Control phrase.: "+getControlPhrase());
		if(archives.length>0) {
			LOGGER.debug("- Custom libraries:");
			for(JavaArchive archive:archives) {
				LOGGER.debug("  + "+archive);
				if(LOGGER.isTraceEnabled() &&
					Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.setup")) &&
					Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.archive"))) {
					LOGGER.trace(archive.toString(true));
				}
			}
		}
	}

	MavenResolverSystem resolver = Maven.
		configureResolver().fromClassloaderResource(getSettings());
	PomEquippedResolveStage mavenResolver=
		resolver.loadPomFromClassLoaderResource(getPom());

	WebArchive war=
		ShrinkWrap.
			create(WebArchive.class, getDeployableName()).
			addAsLibraries(
				mavenResolver.
					importRuntimeDependencies().asFile()).
			addAsLibraries(archives).
			addAsWebResource(
				new StringAsset(getControlPhrase()),"index.html");

	updateWebInf(war);

	if(LOGGER.isTraceEnabled() &&
		Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.setup")) &&
		Boolean.parseBoolean(System.getProperty("org.ldp4j.testing.logging.archive"))) {
		LOGGER.trace(String.format("Testing web application archive: \n%s",war.toString(true)));
	}

	return war;
}
 
开发者ID:ldp4j,项目名称:ldp4j,代码行数:50,代码来源:ServerFrontendWebAppBuilder.java



注:本文中的org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Gamma类代码示例发布时间:2022-05-21
下一篇:
Java StaticResource类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap