public static JavaArchive[] awaitability() { return Maven.resolver() .loadPomFromFile("pom.xml") .resolve("org.assertj:assertj-core", "com.jayway.awaitility:awaitility") .withTransitivity() .as(JavaArchive.class); }
@Deployment public static WebArchive processArchive() { return initWebArchiveDeployment("test.war", "singleEngineWithProcessEnginePlugin.xml") .addClass(GroovyProcessEnginePlugin.class) .addAsResource("org/camunda/bpm/integrationtest/deployment/war/groovy.bpmn20.xml") .addAsResource("org/camunda/bpm/integrationtest/deployment/war/groovyAsync.bpmn20.xml") .addAsLibraries(Maven.resolver() .offline() .loadPomFromFile("pom.xml") .resolve("org.codehaus.groovy:groovy-all") .withoutTransitivity() .as(JavaArchive.class)); }
private MavenResolverSystem getMavenResolver() { String mavenSettings = configuration.getMavenSettings(); if (mavenSettings == null || mavenSettings.isEmpty()) { return Maven.resolver(); } else { return Maven.configureResolver().fromFile(mavenSettings); } }
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]; }
public static File[] resolveDependencies(final String coords) { return Maven.resolver().loadPomFromFile("pom.xml") .resolve(coords) .withTransitivity().asFile(); } }
public void unpackContainerConfigurationFiles(@Observes ConfigureContainer event) { Validate.notNull(configuration, "fundamental test configuration is not setup"); String configurationFiles = configuration.getContainerConfiguration(); if (configurationFiles == null || configurationFiles.isEmpty()) { return; } Validate.notNull(configuration.getContainerHome(), "container home must be set"); File containerHome = new File(configuration.getContainerHome()); InputStream artifactStream = Maven.resolver().resolve(configurationFiles).withClassPathResolution(false).withoutTransitivity().asSingleInputStream(); unzip(artifactStream, containerHome, true); log.info(String.format("The container configuration '%s' was unpacked into '%s'", configurationFiles, containerHome.getAbsolutePath())); }
public static JavaArchive[] awaitability() { return Maven.resolver() .loadPomFromFile("pom.xml") .resolve("org.assertj:assertj-core", "com.jayway.awaitility:awaitility") .withTransitivity() .as(JavaArchive.class); }
/** * 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 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; } }
/** * Obtains JavaArchive with phantomjs binary */ protected File getJavaArchive(String version) { String v = version; if (v == null) { v = ResolverConfiguration.get().version(); } final String gav = getArtifactCanonicalForm(v); return Maven.resolver().resolve(gav).withoutTransitivity().asSingleFile(); }
@Override public File call() throws Exception { return Maven.resolver().resolve(distributableCoordinate.toCanonicalForm()) .withoutTransitivity() .asSingle(GenericArchive.class) .as(ExplodedExporter.class) .exportExploded(targetDirectory, "."); } });
@Override public File call() throws Exception { return Maven.resolver().resolve(distributableCoordinate.toCanonicalForm()) .withoutTransitivity() .asSingle(GenericArchive.class) .as(ExplodedExporter.class) .exportExploded(targetDirectory, "."); } });
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() ); } }
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() ); } }
/** * @return the Maven coordinates of all archives returned by {@link #hibernateSearchLibraries()} */ private static String[] coordinatesOfHibernateSearchLibraries() { return Maven.resolver() .resolve( "org.hibernate:hibernate-search-orm:" + getCurrentVersion() ) .using( new RejectDependenciesStrategy( false, exclusions ) ) .asList( MavenResolvedArtifact.class ) .stream().map( m -> m.getCoordinate().getGroupId().toString() + ":" + m.getCoordinate().getArtifactId().toString() ) .toArray( String[]::new ); }
public static File[] resolveDependencies() { return Maven.resolver().loadPomFromFile("pom.xml") .resolve( "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider") .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()); }
/** * Returns the set of dependencies defined as org.hibernate:hibernate-search-testing at * the version being built, including transitive dependencies but strictly excluding * anything which would be provided by {@link #hibernateSearchLibraries()} so that * the two combined would not contain duplicates. */ public static JavaArchive[] hibernateSearchTestingLibraries() { return Maven.resolver() .resolve( "org.hibernate:hibernate-search-testing:" + getCurrentVersion() ) .using( new RejectDependenciesStrategy( false, coordinatesOfHibernateSearchLibraries() ) ) .as( JavaArchive.class ); }