if ( dep.isOptional() )
private static org.apache.maven.artifact.Artifact toArtifact( Dependency dependency ) { if ( dependency == null ) { return null; } org.apache.maven.artifact.Artifact result = toArtifact( dependency.getArtifact() ); result.setScope( dependency.getScope() ); result.setOptional( dependency.isOptional() ); return result; }
if ( d.isOptional() )
public boolean selectDependency( Dependency dependency ) { return depth < 2 || !dependency.isOptional(); }
public boolean selectDependency( Dependency dependency ) { return depth < 2 || !dependency.isOptional(); }
public boolean matches(Dependency tree) { return tree.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; } };
private boolean deriveOptional( DependencyNode node, Object conflictId ) { Dependency dep = node.getDependency(); boolean optional = ( dep != null ) ? dep.isOptional() : false; if ( optional || ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) != 0 || ( conflictId != null && resolvedIds.containsKey( conflictId ) ) ) { return optional; } int depth = parentNodes.size(); return ( depth > 0 ) ? parentOptionals.get( depth - 1 ) : false; }
private boolean deriveOptional( DependencyNode node, Object conflictId ) { Dependency dep = node.getDependency(); boolean optional = ( dep != null ) ? dep.isOptional() : false; if ( optional || ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) != 0 || ( conflictId != null && resolvedIds.containsKey( conflictId ) ) ) { return optional; } int depth = parentNodes.size(); return ( depth > 0 ) ? parentOptionals.get( depth - 1 ) : false; }
@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) { if (!isExcluded(dependency)) { boolean optional = dependency.isOptional(); return !optional && hasRequiredScope(dependency); } return false; }
@Override public boolean selectDependency(Dependency dependency) { if (!isExcluded(dependency)) { boolean optional = dependency.isOptional(); return !optional && hasRequiredScope(dependency); } return false; }
@Override public boolean accept(DependencyNode node, List<DependencyNode> parents) { // optional nodes are rejected conditionally // nodes included explicitly are always accepted return (acceptOptional || !node.getDependency().isOptional()) && (isIncludedDirectly(node) || patternExclusionsDependencyFilter.accept(node, parents)); }
private boolean chooseEffectiveOptionality( Collection<ConflictItem> items ) { boolean optional = true; for ( ConflictItem item : items ) { if ( item.getDepth() <= 1 ) { return item.getDependency().isOptional(); } if ( ( item.getOptionalities() & ConflictItem.OPTIONAL_FALSE ) != 0 ) { optional = false; } } return optional; }
private boolean chooseEffectiveOptionality( Collection<ConflictItem> items ) { boolean optional = true; for ( ConflictItem item : items ) { if ( item.getDepth() <= 1 ) { return item.getDependency().isOptional(); } if ( ( item.getOptionalities() & ConflictItem.OPTIONAL_FALSE ) != 0 ) { optional = false; } } return optional; }
private static org.apache.maven.artifact.Artifact toArtifact(Dependency dependency) { if (dependency == null) { return null; } org.apache.maven.artifact.Artifact result = toArtifact(dependency.getArtifact()); result.setScope(dependency.getScope()); result.setOptional(dependency.isOptional()); return result; }
private static org.apache.maven.artifact.Artifact toArtifact(Dependency dependency) { if (dependency == null) { return null; } org.apache.maven.artifact.Artifact result = toArtifact(dependency.getArtifact()); result.setScope(dependency.getScope()); result.setOptional(dependency.isOptional()); return result; }
private Artifact getDependencyArtifact( Dependency dep ) { org.eclipse.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 static Dependency convertToDependency(ResourceFactory factory, DependencyNode node) { org.eclipse.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; }