protected MavenDependency getComponentRuntimeBeamDependency() { return createDependency("org.talend.sdk.component:component-runtime-beam:jar:" + kitVersion, RUNTIME, false); }
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; } } }
/** * Creates a new {@link MavenDependency} instance from the specified properties. If no {@link ScopeType} is * specified, default will be {@link ScopeType#COMPILE}. * * @param coordinate A coordinate of the new {@link MavenDependency} instance. * @param scope A scope of the new {@link MavenDependency} instance. Default will be {@link ScopeType#COMPILE}. * @param optional Whether or not this {@link MavenDependency} has been marked as optional; defaults to <code>false</code>. * @param exclusions Exclusions of the new {@link MavenDependency} instance. * @return The new {@link MavenDependency} instance. * @throws IllegalArgumentException * If the coordinate is not supplied * @throws CoordinateParseException * If the specified canonical form is not valid */ public static MavenDependency createDependency(final MavenCoordinate coordinate, final ScopeType scope, final boolean optional, final MavenDependencyExclusion... exclusions) throws IllegalArgumentException, CoordinateParseException { if (coordinate == null) { throw new IllegalArgumentException("coordinate form is required"); } final MavenDependency dep = newInstance(coordinate, scope, optional, exclusions); return dep; }
private static MavenDependencyExclusion[] toMavenExclusions(String[] exclusions) { MavenDependencyExclusion[] mavenExclusions = new MavenDependencyExclusion[exclusions.length]; for (int i = 0; i < exclusions.length; i++) { mavenExclusions[i] = MavenDependencies.createExclusion(exclusions[i]); } return mavenExclusions; } }
private static MavenDependencyExclusion[] toMavenExclusions(String[] exclusions) { MavenDependencyExclusion[] mavenExclusions = new MavenDependencyExclusion[exclusions.length]; for (int i = 0; i < exclusions.length; i++) { mavenExclusions[i] = MavenDependencies.createExclusion(exclusions[i]); } return mavenExclusions; } }
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; }
.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())
public static MavenDependencyExclusion fromExclusion(final Exclusion exclusion) { final MavenDependencyExclusion translated = MavenDependencies.createExclusion(exclusion.getGroupId(), exclusion.getArtifactId()); return translated; }
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; }
public static MavenDependencyExclusion fromExclusion(final Exclusion exclusion) { final MavenDependencyExclusion translated = MavenDependencies.createExclusion(exclusion.getGroupId(), exclusion.getArtifactId()); return translated; }
protected MavenDependency getRunnerDependency() { return createDependency(rootDependencyBase() + ":jar:" + beamVersion, RUNTIME, false); }
public static MavenDependencyExclusion fromExclusion(final org.apache.maven.model.Exclusion exclusion) { final MavenDependencyExclusion translated = MavenDependencies.createExclusion(exclusion.getGroupId(), exclusion.getArtifactId()); return translated; }
public RejectDependenciesFilter(final boolean rejectTransitives, final String... coordinates) throws IllegalArgumentException, CoordinateParseException { if (coordinates == null || coordinates.length == 0) { throw new IllegalArgumentException("There must be at least one coordinate specified to be rejected."); } final Set<MavenDependency> bannedDependencies = new HashSet<MavenDependency>(coordinates.length); for (final String coords : coordinates) { final MavenCoordinate coordinate = MavenCoordinates.createCoordinate(coords); final MavenDependency dependency = MavenDependencies.createDependency(coordinate, ScopeType.COMPILE, false); bannedDependencies.add(dependency); } this.bannedDependencies = Collections.unmodifiableSet(bannedDependencies); this.rejectTransitives = rejectTransitives; }
public static MavenDependencyExclusion fromExclusion(final org.apache.maven.model.Exclusion exclusion) { final MavenDependencyExclusion translated = MavenDependencies.createExclusion(exclusion.getGroupId(), exclusion.getArtifactId()); return translated; }
private MavenDependency resolveDependency(final String coordinate) { assert coordinate != null && coordinate.length() > 0 : "Coordinate is required"; final MavenCoordinate newCoordinate = MavenCoordinates.createCoordinate(coordinate); final MavenDependency declared = MavenDependencies.createDependency(newCoordinate, null, false); final MavenDependency resolved = this.resolveDependency(declared); return resolved; }
throw new CoordinateParseException("Canonical form must be \"groupId:artifactId\"; got: " + canonicalForm); final MavenDependencyExclusion exclusion = createExclusion(groupId, artifactId); return exclusion;
private MavenDependency resolveDependency(final String coordinate) { assert coordinate != null && coordinate.length() > 0 : "Coordinate is required"; final MavenCoordinate newCoordinate = MavenCoordinates.createCoordinate(coordinate); final MavenDependency declared = MavenDependencies.createDependency(newCoordinate, null, false); final MavenDependency resolved = this.resolveDependency(declared); return resolved; }
/** * Creates a new {@link MavenDependency} instance from the specified, required canonical form in format * {@code <groupId>:<artifactId>[:<packagingType>[:<classifier>]][:<version>]}, with the additional, optional * properties. If no {@link ScopeType} is specified, default will be {@link ScopeType#COMPILE}. * * @param canonicalForm A canonical form in format {@code <groupId>:<artifactId>[:<packagingType>[:<classifier>]][:<version>]} * of the new {@link MavenDependency} instance. * @param scope A scope of the new {@link MavenDependency} instance. Default will be {@link ScopeType#COMPILE}. * @param optional Whether or not this {@link MavenDependency} has been marked as optional; defaults to <code>false</code>. * @param exclusions Exclusions of the new {@link MavenDependency} instance. * @return The new {@link MavenDependency} instance. * @throws IllegalArgumentException * If the canonical form is not supplied * @throws CoordinateParseException * If the specified canonical form is not valid */ public static MavenDependency createDependency(final String canonicalForm, final ScopeType scope, final boolean optional, final MavenDependencyExclusion... exclusions) throws IllegalArgumentException, CoordinateParseException { if (canonicalForm == null || canonicalForm.length() == 0) { throw new IllegalArgumentException("canonical form is required"); } final MavenCoordinate delegate = MavenCoordinates.createCoordinate(canonicalForm); return createDependency(delegate, scope, optional, exclusions); }
/** * Run post-resolution filtering to weed out POMs. * * @param artifactResults The original list of resolved artifacts * @return List of modified artifactResults */ static Collection<MavenResolvedArtifact> postFilter(final Collection<MavenResolvedArtifact> artifactResults) { final MavenResolutionFilter postResolutionFilter = RestrictPomArtifactFilter.INSTANCE; final Collection<MavenResolvedArtifact> filteredArtifacts = new ArrayList<MavenResolvedArtifact>(); final List<MavenDependency> emptyList = Collections.emptyList(); for (final MavenResolvedArtifact artifact : artifactResults) { final MavenDependency dependency = MavenDependencies.createDependency(artifact.getCoordinate(), ScopeType.COMPILE, false); // Empty lists OK here because we know the RestrictPOM Filter doesn't consult them if (postResolutionFilter.accepts(dependency, emptyList, emptyList)) { filteredArtifacts.add(artifact); } } return Collections.unmodifiableCollection(filteredArtifacts); }
/** * Run post-resolution filtering to weed out POMs. * * @param artifactResults The original list of resolved artifacts * @return List of modified artifactResults */ static Collection<MavenResolvedArtifact> postFilter(final Collection<MavenResolvedArtifact> artifactResults) { final MavenResolutionFilter postResolutionFilter = RestrictPomArtifactFilter.INSTANCE; final Collection<MavenResolvedArtifact> filteredArtifacts = new ArrayList<MavenResolvedArtifact>(); final List<MavenDependency> emptyList = Collections.emptyList(); for (final MavenResolvedArtifact artifact : artifactResults) { final MavenDependency dependency = MavenDependencies.createDependency(artifact.getCoordinate(), ScopeType.COMPILE, false); // Empty lists OK here because we know the RestrictPOM Filter doesn't consult them if (postResolutionFilter.accepts(dependency, emptyList, emptyList)) { filteredArtifacts.add(artifact); } } return Collections.unmodifiableCollection(filteredArtifacts); }