Package org.jboss.shrinkwrap.resolver.api.maven

Examples of org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver


      return artifacts;
   }

   private File[] resolveArtifact(final String artifact)
   {
      final MavenDependencyResolver mvnResolver = DependencyResolvers.use(MavenDependencyResolver.class);

      if (mavenIsUsed())
      {
         mvnResolver.loadMetadataFromPom(POM_XML);
      }

      final String alternateMavenSettings = System.getProperty(MVN_ALTERNATE_SETTINGS);
      if (alternateMavenSettings != null)
      {
         mvnResolver.configureFrom(alternateMavenSettings);
      }

      return mvnResolver.artifact(artifact)
                        .resolveAsFiles();
   }
View Full Code Here


    return getValidAirport(0, code, name);
  }

  public static Archive<?> createIntegrationTestArchive() {

    MavenDependencyResolver mvnResolver = DependencyResolvers.use(MavenDependencyResolver.class)
        .loadMetadataFromPom("pom.xml");

    WebArchive war = ShrinkWrap.create(WebArchive.class, "plane_test.war").addPackages(true, "se.plushogskolan")
        .addAsWebInfResource("beans.xml").addAsResource("META-INF/persistence.xml");

    war.addAsLibraries(mvnResolver.artifact("org.easymock:easymock:3.2").resolveAsFiles());
    war.addAsLibraries(mvnResolver.artifact("joda-time:joda-time:2.2").resolveAsFiles());
    war.addAsLibraries(mvnResolver.artifact("org.jadira.usertype:usertype.core:3.1.0.CR8").resolveAsFiles());

    log.info("JAR: " + war.toString(true));
    return war;
  }
View Full Code Here

//  static String process ="yao-invoice_en";
   

  @Deployment 
  public static WebArchive createDeployment() {
    MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class).goOffline().loadMetadataFromPom("pom.xml");
   
    return ShrinkWrap.create(WebArchive.class, "test.war")
            // prepare as process application archive for fox platform
//            .addAsManifestResource("ARQUILLIAN-MANIFEST-JBOSS7.MF", "MANIFEST.MF")
            .addAsLibraries(resolver.artifact("com.camunda.fox.platform:fox-platform-client").resolveAsFiles())
            .addAsWebResource("META-INF/processes.xml", "WEB-INF/classes/META-INF/processes.xml")
            // add your own classes (could be done one by one as well)
            //.addPackages(true, "com.camunda.fox.showcase.invoice")
            .addPackages(true, "com.camunda.fox.showcase.invoice.test.mock")
            // add process definition
View Full Code Here

//  static String process ="yao"+"-invoice";
   

  @Deployment 
  public static WebArchive createDeployment() {
    MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class).goOffline().loadMetadataFromPom("pom.xml");
   
    return ShrinkWrap.create(WebArchive.class, "test.war")
            // prepare as process application archive for fox platform
//            .addAsManifestResource("ARQUILLIAN-MANIFEST-JBOSS7.MF", "MANIFEST.MF")
            .addAsLibraries(resolver.artifact("com.camunda.fox.platform:fox-platform-client").resolveAsFiles())
            .addAsWebResource("META-INF/processes.xml", "WEB-INF/classes/META-INF/processes.xml")
            // add your own classes (could be done one by one as well)
            //.addPackages(true, "com.camunda.fox.showcase.invoice")
            .addPackages(true, "com.camunda.fox.showcase.invoice.test.mock")
            // add process definition
View Full Code Here

    return getValidAirport(id, "GBG", "Gothenburg City airport");
  }

  public static Archive<?> createIntegrationTestArchive() {

    MavenDependencyResolver mvnResolver = DependencyResolvers.use(MavenDependencyResolver.class)
        .loadMetadataFromPom("pom.xml");

    WebArchive war = ShrinkWrap.create(WebArchive.class, "plane_test.war").addPackages(true, "se.plushogskolan")
        .addAsWebInfResource("beans.xml").addAsResource("META-INF/persistence.xml");

    war.addAsLibraries(mvnResolver.artifact("org.easymock:easymock:3.2").resolveAsFiles());
    war.addAsLibraries(mvnResolver.artifact("joda-time:joda-time:2.2").resolveAsFiles());
    war.addAsLibraries(mvnResolver.artifact("org.jadira.usertype:usertype.core:3.1.0.CR8").resolveAsFiles());

    log.info("JAR: " + war.toString(true));
    return war;
  }
View Full Code Here

@RunWith(Arquillian.class)
public class ArquillianTestCase {

  @Deployment 
  public static WebArchive createDeployment() {
    MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class).loadMetadataFromPom("pom.xml");
   
    return ShrinkWrap.create(WebArchive.class, "test.war")
            // prepare as process application archive for fox platform
            .addAsLibraries(resolver.artifact("com.camunda.fox.platform:fox-platform-client").resolveAsFiles())
            .addAsWebResource("META-INF/processes.xml", "WEB-INF/classes/META-INF/processes.xml")
            .addAsWebResource("META-INF/persistence.xml", "WEB-INF/classes/META-INF/persistence.xml")
            .addAsWebResource("META-INF/beans.xml", "WEB-INF/classes/META-INF/beans.xml")
            // add your own classes (could be done one by one as well)
            .addPackages(true, "com.camunda.sample")
View Full Code Here

        return null;
    }

    private Bundle installBundle(String groupId, String artifactId, String version, boolean startBundle) throws BundleException {
        String filespec = groupId + ":" + artifactId + ":jar:" + version;
        MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class);
        File[] resolved = resolver.artifact(filespec).resolveAsFiles(new StrictFilter());
        if (resolved == null || resolved.length == 0)
            throw new BundleException("Cannot obtain maven artifact: " + filespec);
        if (resolved.length > 1)
            throw new BundleException("Multiple maven artifacts for: " + filespec);
View Full Code Here

        return null;
    }

    private Bundle installBundle(String groupId, String artifactId, String version, boolean startBundle) throws BundleException {
        String filespec = groupId + ":" + artifactId + ":jar:" + version;
        MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class);
        File[] resolved = resolver.artifact(filespec).resolveAsFiles(new StrictFilter());
        if (resolved == null || resolved.length == 0)
            throw new BundleException("Cannot obtain maven artifact: " + filespec);
        if (resolved.length > 1)
            throw new BundleException("Multiple maven artifacts for: " + filespec);
View Full Code Here

     *
     * @return the resolved files
     */
    private File[] resolveArtifact(String artifact, String... exclusions) {

        MavenDependencyResolver mvnDependencyResolver = DependencyResolvers.use(MavenDependencyResolver.class);

        if (isMavenUsed()) {
            mvnDependencyResolver.loadMetadataFromPom(SpringDeployerConstants.POM_XML);
        }

        return mvnDependencyResolver.artifacts(artifact).exclusions(exclusions).resolveAsFiles();
    }
View Full Code Here

  public static WebArchive initWebArchiveDeployment() {
    return initWebArchiveDeployment("test.war");
  }
 
  public static File[] getFoxPlatformClient() {
    MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class).goOffline().loadMetadataFromPom("pom.xml");
    return resolver.artifact("com.camunda.fox:fox-platform-client").resolveAsFiles();
  }
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.