.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())
private File shrinkwrapResolve(MavenCoordinates artefact) { File[] resolved = Maven.resolver().resolve(artefact.toString()).withoutTransitivity().asFile(); if (resolved == null || resolved.length == 0) throw new IllegalStateException("Cannot obtain maven artefact: " + artefact); if (resolved.length > 1) throw new IllegalStateException("Multiple maven artefacts for: " + artefact); return resolved[0]; }
private File shrinkwrapResolve(MavenCoordinates artefact) { File[] resolved = Maven.resolver().resolve(artefact.toString()).withoutTransitivity().asFile(); if (resolved == null || resolved.length == 0) throw new IllegalStateException("Cannot obtain maven artefact: " + artefact); if (resolved.length > 1) throw new IllegalStateException("Multiple maven artefacts for: " + artefact); return resolved[0]; }
/** * Resolves the given artifact by it's name with help of maven build system. * * @param artifact the fully qualified artifact name * * @return the resolved files */ private File[] resolveArtifact(String artifact) { return Maven.resolver() .resolve(artifact) .withTransitivity() .asFile(); } }
public static File[] resolveDependencies(final String coords) { return Maven.resolver().loadPomFromFile("pom.xml") .resolve(coords) .withTransitivity().asFile(); } }
/** * Resolve an {@link Archive} from Maven coordinates. */ protected static File[] resolveDependencies(final String coords) { return Maven.resolver() .loadPomFromFile("pom.xml") .resolve(coords) .withTransitivity() .asFile(); }
public File[] asFiles() { return Maven.resolver().loadPomFromFile(filesystemPomPath).resolve(artifacts).withTransitivity().asFile(); }
public Builder withPomDependencies() { dependencies = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve().withTransitivity().asFile(); return this; }
public static File[] neo4j() { long start = System.currentTimeMillis(); File[] result = Maven.resolver() .loadPomFromFile("pom.xml") .resolve("org.neo4j:neo4j") .withTransitivity() .asFile(); System.out.println("Neo4j Resovled in " + (System.currentTimeMillis() - start) + " ms"); return result; } }
public static File[] transitive(PomStrategy pomStrategy, String groupId, String artifactId) { return Maven.resolver().loadPomFromFile(pomStrategy.toPom(), pomStrategy.profiles()).resolve(groupId + ":" + artifactId).withTransitivity().asFile(); } }
private static Collection<File> dependency(String gav, boolean transitive) { MavenStrategyStage mavenStrategyStage = Maven.resolver().resolve( gav ); MavenFormatStage mavenFormatStage; if ( transitive ) { mavenFormatStage = mavenStrategyStage.withTransitivity(); } else { mavenFormatStage = mavenStrategyStage.withoutTransitivity(); } return Arrays.asList( mavenFormatStage.asFile() ); } }
public static File[] single(PomStrategy pomStrategy, String groupId, String artifactId) { return Maven.resolver().loadPomFromFile(pomStrategy.toPom(), pomStrategy.profiles()).resolve(groupId + ":" + artifactId).withoutTransitivity().asFile(); }
private static Collection<File> dependency(String gav, boolean transitive) { MavenStrategyStage mavenStrategyStage = Maven.resolver().resolve( gav ); MavenFormatStage mavenFormatStage; if ( transitive ) { mavenFormatStage = mavenStrategyStage.withTransitivity(); } else { mavenFormatStage = mavenStrategyStage.withoutTransitivity(); } return Arrays.asList( mavenFormatStage.asFile() ); } }
@Override public void process(Archive<?> applicationArchive, TestClass testClass) { if (applicationArchive instanceof WebArchive) { WebArchive testDeployment = (WebArchive) applicationArchive; // Add CDI and JAX-RS support String[] deps = { "io.smallrye:smallrye-rest-client", "io.smallrye:smallrye-config", "org.jboss.weld.servlet:weld-servlet-core", "org.jboss.resteasy:resteasy-cdi" }; // Workaround for RESTEASY-1922 testDeployment.addClass(FixedResteasyServletInitializer.class); testDeployment.addAsServiceProvider(ServletContainerInitializer.class, FixedResteasyServletInitializer.class); // Register SmallRyeBeanArchiveHandler using the ServiceLoader mechanism testDeployment.addClass(SmallRyeBeanArchiveHandler.class); testDeployment.addAsServiceProvider(BeanArchiveHandler.class, SmallRyeBeanArchiveHandler.class); File[] dependencies = Maven.resolver().loadPomFromFile(new File("pom.xml")).resolve(deps).withTransitivity().asFile(); testDeployment.addAsLibraries(dependencies); } }
public static File[] resolveDependencies() { return Maven.resolver().loadPomFromFile("pom.xml") .resolve( "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider") .withTransitivity() .asFile(); }
@Test(expected = NoResolvedResultException.class) public void testFailingDependency() throws Exception { jqmlogger.debug("**********************************************************"); jqmlogger.debug("Starting test testFailingDependency"); SLF4JBridgeHandler.install(); Maven.configureResolver() .withRemoteRepo(MavenRemoteRepositories.createRemoteRepository("marsu", "http://marsupilami.com", "default")) .withMavenCentralRepo(false).resolve("com.enioka.jqm:marsu:1.1.4").withTransitivity().asFile(); } }
public static File[] resolveDependencies() { return Maven.resolver() .offline() .loadPomFromFile("pom.xml") .resolve( "org.infinispan:infinispan-core") .withTransitivity() .asFile(); } }
@Deployment public static WebArchive deploy() { return ShrinkWrap.create(WebArchive.class) .addClasses(AuthServlet.class, HttpObjectHolder.class, ControllableAuthenticator.class) .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") .addAsLibraries( Maven.resolver() .loadPomFromFile("pom.xml") .resolve("org.picketlink:picketlink-impl") .withTransitivity() .asFile()); }
@Deployment public static WebArchive createDeployment() { File[] libs = Maven.resolver() .loadPomFromFile("pom.xml").resolve("org.kie:kie-spring", "com.google.protobuf:protobuf-java") .withTransitivity().asFile(); WebArchive drools = ShrinkWrap.create(WebArchive.class) .addAsLibraries(libs) .addAsResource("spring/sample.drl") .addAsResource(APL_CONTEXT) .addAsResource("META-INF/maven/pom.properties") .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); System.out.println(drools.toString(true)); return drools; }
@Deployment public static WebArchive createDeployment() { File[] libs = Maven.resolver() .loadPomFromFile("pom.xml").resolve("org.drools:drools-compiler", "com.google.protobuf:protobuf-java") .withTransitivity().asFile(); WebArchive drools = ShrinkWrap.create(WebArchive.class) .addAsLibraries(libs) .addClass(TestFactDeclaredInJar.class) .addAsResource("basic/sample.drl") .addAsResource("META-INF/kmodule.xml") .addAsResource("META-INF/maven/pom.properties") .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); System.out.println(drools.toString(true)); return drools; }