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

Java ScopeType类代码示例

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

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



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

示例1: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
@Deployment
public static EnterpriseArchive createDeployment() {
   WebArchive war = ShrinkWrap.create(WebArchive.class) //
      .addClasses(UserService.class, UserRepository.class, User.class) //
      .addClasses(UserRepositoryTest.class, DockerDatabaseTestUtil.class) //
      .addAsResource("META-INF/persistence.xml") //
      .addAsResource("testdata.xml") //
      .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

   File[] pomDependencies = Maven.resolver() //
      .loadPomFromFile("pom.xml").importDependencies(ScopeType.TEST) //
      .resolve().withTransitivity().asFile();

   EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class) //
      .addAsModule(war) //
      .addAsLibraries(pomDependencies);

   return ear;
}
 
开发者ID:kaiwinter,项目名称:testcontainers-examples,代码行数:20,代码来源:UserRepositoryTest.java


示例2: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
@Deployment
public static EnterpriseArchive createDeployment() {
   WebArchive war = ShrinkWrap.create(WebArchive.class) //
      .addClasses(UserService.class, UserRepository.class, User.class) //
      .addClasses(UserServiceTest.class, DockerDatabaseTestUtil.class) //
      .addAsResource("META-INF/persistence.xml") //
      .addAsResource("testdata.xml") //
      .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

   File[] pomDependencies = Maven.resolver() //
      .loadPomFromFile("pom.xml").importDependencies(ScopeType.TEST) //
      .resolve().withTransitivity().asFile();

   EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class) //
      .addAsModule(war) //
      .addAsLibraries(pomDependencies);

   return ear;
}
 
开发者ID:kaiwinter,项目名称:testcontainers-examples,代码行数:20,代码来源:UserServiceTest.java


示例3: deployment

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
@Deployment
public static Archive<?> deployment() {

    File[] filesCompile = Maven.resolver().loadPomFromFile("pom.xml").importDependencies(ScopeType.COMPILE).resolve().withTransitivity().asFile();
    File[] filestest = Maven.resolver().loadPomFromFile("pom.xml")
            .resolve("com.fasterxml.jackson.core:jackson-annotations", "com.fasterxml.jackson.core:jackson-databind", "com.fasterxml.jackson.core:jackson-core").withTransitivity().asFile();

    JavaArchive jar = ShrinkWrap.create(MavenImporter.class)
            .loadPomFromFile("pom.xml")
            .importBuildOutput()
            .as(JavaArchive.class);

    WebArchive war = ShrinkWrap.create(WebArchive.class)
            .addAsLibraries(filestest)
            .addAsLibraries(jar)
            .addAsLibraries(filesCompile)
            .addClasses(UserDefaultExample.class, UserRepositoryExample.class)
            .addClasses(JAXRSConfigurationExample.class, ObjectMapperProviderExample.class, ResourceExample.class)
            .addAsWebInfResource("WEB-INF/test.shiro.ini", "shiro.ini")
            .addAsWebInfResource("WEB-INF/web.xml", "web.xml")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

    System.out.println(war.toString(true));

    return war;
}
 
开发者ID:panchitoboy,项目名称:shiro-jwt,代码行数:27,代码来源:JWTOrFormAuthenticationFilterTest.java


示例4: ear

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
@Deployment(testable = false)
public static Archive<?> ear() {
    final File[] joda = Maven.resolver()
            .offline()
            .resolve("joda-time:joda-time:2.5")
            .withClassPathResolution(true)
            .using(new AcceptScopesStrategy(ScopeType.COMPILE, ScopeType.RUNTIME))
            .asFile();
    return ShrinkWrap.create(EnterpriseArchive.class, "broken.ear")
            .addAsLibraries(joda)
            .addAsModule(ShrinkWrap.create(WebArchive.class, "broken-web.war")
                    .addClasses(LoadJodaFromTheWebAppResource.class)
                    .addAsManifestResource(new StringAsset(
                            "<Context>" +
                                    "<Loader className=\"" + TomEEWebappLoader.class.getName() +
                                    "\" loaderClass=\"" + WebAppFirstEarClassLoader.class.getName() + "\" />" +
                            "</Context>"), "context.xml")
                    .addAsLibraries(joda));
}
 
开发者ID:apache,项目名称:tomee,代码行数:20,代码来源:EarWebAppFirstClassLoaderTest.java


示例5: ear

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
@Deployment(testable = false)
public static Archive<?> ear() {
    return ShrinkWrap.create(EnterpriseArchive.class, "broken.ear")
            .addAsModule(
                    ShrinkWrap.create(WebArchive.class, "broken-web.war")
                            .addClasses(LoadJodaFromTheWebAppResource.class)
                            .addAsLibraries(
                                    Maven.resolver()
                                            .offline()
                                            .resolve("joda-time:joda-time:2.5")
                                            .withClassPathResolution(true)
                                            .using(new AcceptScopesStrategy(ScopeType.COMPILE, ScopeType.RUNTIME))
                                            .asFile()
                            )
            );
}
 
开发者ID:apache,项目名称:tomee,代码行数:17,代码来源:EarClassLoaderTest.java


示例6: getEngineSpring

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
public static JavaArchive[] getEngineSpring() {
  if(CACHED_SPRING_ASSETS != null) {
    return CACHED_SPRING_ASSETS;
  } else {

    JavaArchive[] resolvedArchives = Maven.configureResolver()
        .workOffline()
        .loadPomFromFile("pom.xml")
        .addDependencies(
            MavenDependencies.createDependency("org.camunda.bpm:camunda-engine-spring", ScopeType.COMPILE, false,
                MavenDependencies.createExclusion("org.camunda.bpm:camunda-engine")),
                MavenDependencies.createDependency("org.springframework:spring-web", ScopeType.COMPILE, false))
        .resolve()
        .withTransitivity()
        .as(JavaArchive.class);

    if(resolvedArchives.length == 0) {
      throw new RuntimeException("could not resolve org.camunda.bpm:camunda-engine-spring");
    } else {
      CACHED_SPRING_ASSETS = resolvedArchives;
      return CACHED_SPRING_ASSETS;
    }
  }

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:DeploymentHelper.java


示例7: createMavenDependency

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
public MavenDependency createMavenDependency(final ArtifactSpec spec) {
    final MavenCoordinate newCoordinate = MavenCoordinates.createCoordinate(
            spec.groupId(),
            spec.artifactId(),
            spec.version(),
            PackagingType.of(spec.type()),
            spec.classifier());
    return MavenDependencies.createDependency(newCoordinate, ScopeType.fromScopeType(spec.scope), false);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:10,代码来源:ShrinkwrapArtifactResolvingHelper.java


示例8: createDeployment

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
   String warName = Tutorial3.class.getSimpleName() + ".war";
   WebArchive archive = ShrinkWrap.create(WebArchive.class, warName);
   archive.setWebXML("tutorial/tut3.webxml");

   archive.addClasses(Person.class, Address.class, TutorialServlet3.class);

   File[] cibet = Maven.resolver().loadPomFromFile("pom.xml").resolve("com.logitags:cibet-jpa").withoutTransitivity()
         .asFile();
   archive.addAsLibraries(cibet);

   File[] shiro = Maven.resolver().loadPomFromFile("pom.xml").resolve("com.logitags:cibet-shiro").withTransitivity()
         .asFile();
   archive.addAsLibraries(shiro);

   File[] shiro1 = Maven.resolver()
         .addDependencies(MavenDependencies.createDependency("org.apache.shiro:shiro-web:1.2.2", ScopeType.COMPILE,
               false, MavenDependencies.createExclusion("org.slf4j:slf4j-api")))
         .resolve().withTransitivity().asFile();
   archive.addAsLibraries(shiro1);

   archive.addAsWebInfResource("tutorial/persistence-it1.xml", "classes/META-INF/persistence.xml");
   archive.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
   archive.addAsWebInfResource("shiro.ini", "classes/shiro.ini");
   archive.addAsWebInfResource("tutorial/config.xml", "classes/cibet-config.xml");

   log.debug(archive.toString(true));
   archive.as(ZipExporter.class).exportTo(new File("target/" + warName), true);

   return archive;
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:33,代码来源:Tutorial3.java


示例9: createBaseDeployment

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的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


示例10: toMavenDependencies

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
public static MavenDependency[] toMavenDependencies(String[] dependencies, String[] exclusions) {
    MavenDependencyExclusion[] mavenExclusions = toMavenExclusions(exclusions);
    MavenDependency[] mavenDependencies = new MavenDependency[dependencies.length];
    for (int i = 0; i < dependencies.length; i++) {
        mavenDependencies[i] = MavenDependencies.createDependency(
            dependencies[i],
            ScopeType.COMPILE,
            false,
            mavenExclusions);
    }
    return mavenDependencies;
}
 
开发者ID:arquillian,项目名称:arquillian-container-chameleon,代码行数:13,代码来源:Utils.java


示例11: addRuntimeSpecificLibraries

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的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


示例12: newMavenDependency

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
protected MavenDependency newMavenDependency(String gav) {
    MavenCoordinate coordinate = MavenCoordinates.createCoordinate(gav.trim());
    return MavenDependencies.createDependency(coordinate, ScopeType.COMPILE, false );
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:5,代码来源:RepackageExtensionMojo.java


示例13: start

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
public void start() {
  Properties serverProperties = readProperties();
  int port = Integer.parseInt(serverProperties.getProperty(PORT_PROPERTY));

  tomcat = new Tomcat();
  tomcat.setPort(port);
  tomcat.setBaseDir(getWorkingDir());

  tomcat.getHost().setAppBase(getWorkingDir());
  tomcat.getHost().setAutoDeploy(true);
  tomcat.getHost().setDeployOnStartup(true);

  String contextPath = "/" + getContextPath();

  PomEquippedResolveStage resolver = Maven.configureResolver()
    .useLegacyLocalRepo(true).workOffline().loadPomFromFile("pom.xml");

  WebArchive wa = ShrinkWrap.create(WebArchive.class, "rest-test.war").setWebXML(webXmlPath)
      .addAsLibraries(resolver.resolve("org.codehaus.jackson:jackson-jaxrs:1.6.5").withTransitivity().asFile())
      .addAsLibraries(resolver.addDependencies(
          MavenDependencies.createDependency("org.mockito:mockito-core", ScopeType.TEST, false,
          MavenDependencies.createExclusion("org.hamcrest:hamcrest-core"))).resolve()
            .withTransitivity().asFile())

      .addAsServiceProvider(ProcessEngineProvider.class, MockedProcessEngineProvider.class)
      .add(new ClassLoaderAsset("runtime/tomcat/context.xml"), "META-INF/context.xml")
      .addPackages(true, "org.camunda.bpm.engine.rest");

  addRuntimeSpecificLibraries(wa, resolver);
  wa.setWebXML(webXmlPath);

  String webAppPath = getWorkingDir() + "/" + getContextPath() + ".war";

  wa.as(ZipExporter.class).exportTo(new File(webAppPath), true);

  tomcat.addWebapp(tomcat.getHost(), contextPath, webAppPath);

  try {
    tomcat.start();
  } catch (LifecycleException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:44,代码来源:TomcatServerBootstrap.java


示例14: testWar

import org.jboss.shrinkwrap.resolver.api.maven.ScopeType; //导入依赖的package包/类
/**
 * Server war without tests clases.
 *
 * @return create a war with src/main/resources, src/main/webapp and all compile, runtime and test dependencies
 */
public static Archive<?> testWar() {
    return new Builder().scopes(ScopeType.COMPILE, ScopeType.RUNTIME, ScopeType.TEST).build();
}
 
开发者ID:apache,项目名称:tomee,代码行数:9,代码来源:Mvn.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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