public boolean matches(Dependency Dependency) { String scope = Dependency.getScope(); return scope != null && scopeFilter.equals(scope); } };
public boolean matches(Dependency Dependency) { String scope = Dependency.getScope(); return scope != null && scopeFilter.equals(scope); } };
public boolean selectDependency( Dependency dependency ) { if ( !transitive ) { return true; } String scope = dependency.getScope(); return ( included.isEmpty() || included.contains( scope ) ) && ( excluded.isEmpty() || !excluded.contains( scope ) ); }
@Override public boolean accept(final DependencyNode node, final List<DependencyNode> parents) { final Dependency dependency = node.getDependency(); if (dependency == null) { return false; } final String scope = dependency.getScope(); final boolean accept = !("test".equals(scope)); return accept; }
public boolean accept( DependencyNode node, List<DependencyNode> parents ) { Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } String scope = node.getDependency().getScope(); return ( included.isEmpty() || included.contains( scope ) ) && ( excluded.isEmpty() || !excluded.contains( scope ) ); }
private String getClasspathScope( DependencyNode node ) { Dependency dependency = node.getDependency(); if ( dependency == null ) { return null; } String scope = dependency.getScope(); if ( JavaScopes.COMPILE.equals( scope ) || JavaScopes.SYSTEM.equals( scope ) || JavaScopes.PROVIDED.equals( scope ) ) { return JavaScopes.COMPILE; } else if ( JavaScopes.RUNTIME.equals( scope ) ) { return JavaScopes.RUNTIME; } else if ( JavaScopes.TEST.equals( scope ) ) { return JavaScopes.TEST; } return null; }
@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(); }
private void resolve( ConflictGroup group, Map<?, ?> conflictIds, Set<?> prerequisites ) { if ( group.scope == null ) { Set<String> inheritedScopes = getInheritedScopes( group, conflictIds, prerequisites ); group.scope = chooseEffectiveScope( inheritedScopes ); } for ( DependencyNode node : group.parents.keySet() ) { if ( node.getPremanagedScope() == null ) { String scope = node.getDependency().getScope(); if ( !group.scope.equals( scope ) && !JavaScopes.SYSTEM.equals( scope ) ) { node.setScope( group.scope ); } } } }
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); }
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() ); }
@Override public boolean visitEnter( DependencyNode dependencyNode ) { TreeEntry entry = new TreeEntry( getModelMapper().map( dependencyNode.getDependency().getArtifact(), Artifact.class ) ); entry.getArtifact().setFileExtension( dependencyNode.getDependency().getArtifact().getExtension() ); entry.getArtifact().setScope( dependencyNode.getDependency().getScope() ); entry.setParent( currentEntry ); currentEntry = entry; if ( firstDependencyNode == null ) { firstDependencyNode = dependencyNode; treeEntries.add( currentEntry ); } else { currentEntry.getParent().getChilds().add( currentEntry ); } return true; }
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; }