@Override public boolean accept(Dependency dependency) { return dependency != null && !dependency.getCoordinate().isSnapshot(); } }
/** * @param dep1 * A native Maven model of a Maven dependency artifact. * @param dep2 * A native Maven model of a Maven dependency artifact. * @return True iff both models have the same group and artifact IDs. */ public static boolean areSameArtifact(final org.jboss.forge.addon.dependencies.Dependency dep1, final org.jboss.forge.addon.dependencies.Dependency dep2) { return dep1.getCoordinate().getGroupId().equals(dep2.getCoordinate().getGroupId()) && dep1.getCoordinate().getArtifactId().equals(dep2.getCoordinate().getArtifactId()); } }
public static CoordinateBuilder create(Coordinate c) { CoordinateBuilder builder = create(); builder.setGroupId(c.getGroupId()).setArtifactId(c.getArtifactId()); builder.setClassifier(c.getClassifier()).setPackaging(c.getPackaging()).setVersion(c.getVersion()); return builder; }
public static Artifact coordinateToMavenArtifact(final Coordinate dep) { Artifact artifact = new DefaultArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getClassifier(), dep.getPackaging() == null ? "jar" : dep.getPackaging(), dep.getVersion()); return artifact; }
public static DependencyBuilder create(final Dependency dep) { DependencyBuilder builder = new DependencyBuilder(); builder.setCoordinate(dep.getCoordinate()); builder.setScopeType(dep.getScopeType()); builder.setArtifact(dep.getArtifact()); builder.setExcludedCoordinates(dep.getExcludedCoordinates()); builder.setOptional(dep.isOptional()); return builder; }
@Override public List<Coordinate> resolveAvailableVersions(final Dependency dep) { DependencyQueryBuilder query = DependencyQueryBuilder.create(dep.getCoordinate()).setRepositories( getRepositories()); if (!Strings.isNullOrEmpty(dep.getCoordinate().getVersion()) && !dep.getCoordinate().getVersion().contains("SNAPSHOT")) { query.setFilter(new NonSnapshotDependencyFilter()); } List<Coordinate> versions = getResolver().resolveVersions(query); return versions; }
private Dependency getUnversioned(Dependency dependency) { return DependencyBuilder.create(dependency).setVersion(null).setOptional(dependency.isOptional()); }
private boolean areCoordinatesMatching(Coordinate coordinate1, Coordinate coordinate2) { return coordinate1.getArtifactId().equals(coordinate2.getArtifactId()) && coordinate1.getGroupId().equals(coordinate2.getGroupId()); }
public void extractArtifact(Coordinate artifactCoords, File targetDir) throws IOException, DependencyException { final DependencyQueryBuilder query = DependencyQueryBuilder.create(artifactCoords); Dependency dependency = depsResolver.resolveArtifact(query); FileResource<?> artifact = dependency.getArtifact(); ZipUtil.unzipToFolder(new File(artifact.getFullyQualifiedName()), targetDir); }
@Override public boolean accept(Dependency dependency) { Version version = SingleVersion.valueOf(dependency.getCoordinate().getVersion()); return version.compareTo(runtimeVersion) > 0 && version.getMajorVersion() == runtimeVersion.getMajorVersion() && "Final".equals(version.getQualifier()); } }));
/** * Creates a {@link DependencyQueryBuilder} based on a {@link DependencyQuery} */ public static DependencyQueryBuilder create(DependencyQuery query) { DependencyQueryBuilder builder = new DependencyQueryBuilder(); builder.setCoordinate(query.getCoordinate()); builder.setFilter(query.getDependencyFilter()); builder.setRepositories(query.getDependencyRepositories()); builder.setScopeType(query.getScopeType()); return builder; }
private SingleVersion getLatestCoreRulesetVersion() { Coordinate lastRelease = this.getLatestReleaseOf(RULES_GROUP_ID, RULESETS_ARTIFACT_ID); if (lastRelease == null) return null; return new SingleVersion(lastRelease.getVersion()); }
/** * Check if the {@link Dependency} object is pointing to a Furnace Addon artifact * * @param coordinate * @return */ public static boolean isForgeAddon(Coordinate coordinate) { return FORGE_ADDON_CLASSIFIER.equals(coordinate.getClassifier()); }
@Override public List<Coordinate> resolveAvailableVersions(final DependencyQuery query) { List<Coordinate> versions = getResolver().resolveVersions(query); return versions; }
public static String getBlacklistedProfile(final Dependency dep) { return getBlacklistedProfile(dep.getCoordinate().getGroupId() + ":" + dep.getCoordinate().getArtifactId()); }
public void extractArtifact(Coordinate artifactCoords, File targetDir) throws IOException, DependencyException { final DependencyQueryBuilder query = DependencyQueryBuilder.create(artifactCoords); Dependency dependency = depsResolver.resolveArtifact(query); FileResource<?> artifact = dependency.getArtifact(); ZipUtil.unzipToFolder(new File(artifact.getFullyQualifiedName()), targetDir); }
public static boolean isBlacklisted(final Dependency dep) { return isBlacklisted(dep.getCoordinate().getGroupId() + ":" + dep.getCoordinate().getArtifactId()); }
/** * @param mavenDep * A native Maven model of a Maven dependency artifact. * @param forgeDep * A forge model of a Maven dependency artifact. * @return True iff both models have the same group and artifact IDs. */ public static boolean areSameArtifact(final Dependency mavenDep, final org.jboss.forge.addon.dependencies.Dependency forgeDep) { return mavenDep.getGroupId().equals(forgeDep.getCoordinate().getGroupId()) && mavenDep.getArtifactId().equals(forgeDep.getCoordinate().getArtifactId()); }
public static Dependency findCamelArtifactDependency(Project project, String artifactId) { List<Dependency> dependencies = project.getFacet(DependencyFacet.class).getEffectiveDependencies(); for (Dependency d : dependencies) { if ("org.apache.camel".equals(d.getCoordinate().getGroupId()) && artifactId.equals(d.getCoordinate().getArtifactId())) { return d; } } return null; }
private boolean isArquillianWildflySwarmDependencyInstalled(DependencyFacet dependencyFacet) { return dependencyFacet.getDependencies().stream() .map(dependency -> dependency.getCoordinate()) .anyMatch(coordinate -> "org.wildfly.swarm".equals(coordinate.getGroupId()) && "arquillian".equals(coordinate.getArtifactId())); }