public boolean matches(Dependency tree) { return tree.isOptional(); }
public boolean matches(Dependency tree) { return tree.isOptional(); }
public boolean selectDependency( Dependency dependency ) { return depth < 2 || !dependency.isOptional(); }
@Override public boolean accept(final DependencyNode node, final List<DependencyNode> parents) { return !node.getDependency().isOptional(); } }
@Override public boolean matches(Dependency tree) { if (tree.isOptional()) { if (excludeAll) { return true; } else { // only exclude optional dependencies which don't match the include filter return !filter.matches(tree); } } return false; } };
@Override public boolean matches(Dependency tree) { if (tree.isOptional()) { if (excludeAll) { return true; } else { // only exclude optional dependencies which don't match the include filter return !filter.matches(tree); } } return false; } };
@Override public String toString() { return String.valueOf( getArtifact() ) + " (" + getScope() + ( isOptional() ? "?" : "" ) + ")"; }
@Override public String toString() { return String.valueOf( getArtifact() ) + " (" + getScope() + ( isOptional() ? "?" : "" ) + ")"; }
@Override public String toString() { return String.valueOf( getArtifact() ) + " (" + getScope() + ( isOptional() ? "?" : "" ) + ")"; }
@Override public boolean selectDependency(Dependency dependency) { boolean result = false; if (!isExcluded(dependency)) { boolean optional = dependency.isOptional(); if (depth < 1) return !optional; String scope = dependency.getScope(); String classifier = dependency.getArtifact().getClassifier(); if ("test".equals(scope)) return false; result = (FORGE_ADDON.equals(classifier) && depth == 1) || (!FORGE_ADDON.equals(classifier) && !"provided".equals(scope) && !optional); } return result; }
public DependencyTree(DependencyId dependencyId, Dependency dependency, List<DependencyTree> children) { this(dependencyId, dependency.getArtifact().getVersion(), children); this.scope = dependency.getScope(); this.optional = dependency.isOptional(); }
public DependencyTree(DependencyId dependencyId, Dependency dependency, List<DependencyTree> children) { this(dependencyId, dependency.getArtifact().getBaseVersion(), children); this.scope = dependency.getScope(); this.optional = dependency.isOptional(); init(children); }
public DependencyTree(DependencyId dependencyId, Dependency dependency, List<DependencyTree> children) { this(dependencyId, dependency.getArtifact().getBaseVersion(), children); this.scope = dependency.getScope(); this.optional = dependency.isOptional(); init(children); }
@Override public boolean traverseDependency(org.sonatype.aether.graph.Dependency dependency) { boolean isForgeAddon = DependencyNodeUtil.FORGE_ADDON_CLASSIFIER.equals(dependency.getArtifact() .getClassifier()); // We don't want to traverse non-addons optional dependencies if (!isForgeAddon && dependency.isOptional()) { return false; } boolean result; if (query.getScopeType() != null) { result = query.getScopeType().equals(dependency.getScope()); } else { result = !"test".equals(dependency.getScope()); } return result; }
private Artifact getDependencyArtifact( Dependency dep ) { Artifact mavenArtifact = RepositoryUtils.toArtifact( dep.getArtifact() ); mavenArtifact.setScope( dep.getScope() ); mavenArtifact.setOptional( dep.isOptional() ); return mavenArtifact; }
private Artifact getDependencyArtifact( Dependency dep ) { org.sonatype.aether.artifact.Artifact artifact = dep.getArtifact(); return factory.createDependencyArtifact( artifact.getGroupId(), artifact.getArtifactId(), VersionRange.createFromVersion( artifact.getVersion() ), artifact.getProperty( "type", artifact.getExtension() ), artifact.getClassifier(), dep.getScope(), dep.isOptional() ); }
public MavenDependencyAdapter(final org.sonatype.aether.graph.Dependency dep) { if (dep == null) { throw new IllegalArgumentException("Dependency must not be null."); } this.setArtifactId(dep.getArtifact().getArtifactId()); this.setGroupId(dep.getArtifact().getGroupId()); this.setClassifier("".equals(dep.getArtifact().getClassifier()) ? null : dep.getArtifact().getClassifier()); this.setExclusions(dep.getExclusions()); this.setOptional(dep.isOptional()); this.setScope(dep.getScope()); this.setType(dep.getArtifact().getExtension()); this.setVersion(dep.getArtifact().getVersion()); }
static Dependency convertToDependency(ResourceFactory factory, DependencyNode node) { org.sonatype.aether.graph.Dependency artifactDependency = node.getDependency(); Artifact artifact = artifactDependency.getArtifact(); File file = artifact.getFile(); @SuppressWarnings("unchecked") FileResource<?> artifactResource = factory.create(FileResource.class, file); Dependency d = DependencyBuilder.create().setArtifactId(artifact.getArtifactId()) .setGroupId(artifact.getGroupId()).setVersion(artifact.getBaseVersion()) .setPackaging(artifact.getExtension()).setArtifact(artifactResource) .setOptional(artifactDependency.isOptional()) .setClassifier(artifact.getClassifier()) .setScopeType(artifactDependency.getScope()); return d; }