public DependencySelector deriveChildSelector( DependencyCollectionContext context ) Collection<Exclusion> exclusions = ( dependency != null ) ? dependency.getExclusions() : null; if ( exclusions == null || exclusions.isEmpty() )
public DependencySelector deriveChildSelector( DependencyCollectionContext context ) Collection<Exclusion> exclusions = ( dependency != null ) ? dependency.getExclusions() : null; if ( exclusions == null || exclusions.isEmpty() )
/** * Builds the Capsule string representation of an Aether Dependency object * * @param d The dependency */ public static String toCapsuleDependencyString(Dependency d) { return toCapsuleArtifactString(d.getArtifact()) + toCapsuleExclusionsString(d.getExclusions()); }
private boolean isExcludedFromParent(Dependency dependency) { boolean result = false; if (parent != null && parent.getExclusions().size() > 0) { for (Exclusion exclusion : parent.getExclusions()) { if (exclusion != null) { if (exclusion.getArtifactId() != null && exclusion.getArtifactId().equals(dependency.getArtifact().getArtifactId())) { if (exclusion.getGroupId() != null && exclusion.getGroupId().equals(dependency.getArtifact().getGroupId())) { result = true; break; } } } } } return result; }
private boolean isExcludedFromParent(Dependency dependency) { boolean result = false; if (parent != null && parent.getExclusions().size() > 0) { for (Exclusion exclusion : parent.getExclusions()) { if (exclusion != null) { if (exclusion.getArtifactId() != null && exclusion.getArtifactId().equals(dependency.getArtifact().getArtifactId())) { if (exclusion.getGroupId() != null && exclusion.getGroupId().equals(dependency.getArtifact().getGroupId())) { result = true; break; } } } } } return result; }
private boolean isExcludedFromParent(Dependency dependency) { boolean result = false; if (parent != null && parent.getExclusions().size() > 0) { for (Exclusion exclusion : parent.getExclusions()) { if (exclusion != null) { if (exclusion.getArtifactId() != null && exclusion.getArtifactId().equals(dependency.getArtifact().getArtifactId())) { if (exclusion.getGroupId() != null && exclusion.getGroupId().equals(dependency.getArtifact().getGroupId())) { result = true; break; } } } } } return result; }
Collection<Exclusion> exclusions = managedDependency.getExclusions(); if ( !exclusions.isEmpty() )
Collection<Exclusion> exclusions = managedDependency.getExclusions(); if ( !exclusions.isEmpty() )
private Dependency toMavenDependency(org.eclipse.aether.graph.Dependency from) { org.eclipse.aether.artifact.Artifact fromArt = from.getArtifact(); Dependency dependency = new Dependency(); dependency.setGroupId(fromArt.getGroupId()); dependency.setArtifactId(fromArt.getArtifactId()); dependency.setVersion(fromArt.getVersion()); dependency.setType(fromArt.getExtension()); dependency.setScope(Artifact.SCOPE_COMPILE.equals(from.getScope()) ? null : from.getScope()); dependency.setClassifier(fromArt.getClassifier()); dependency.setOptional(dependency.isOptional()); if (from.getExclusions() != null && from.getExclusions().size() > 0) { List<Exclusion> exclusions = new LinkedList<Exclusion>(); for (org.eclipse.aether.graph.Exclusion fromEx : from.getExclusions()) { Exclusion ex = new Exclusion(); ex.setGroupId(fromEx.getGroupId()); ex.setArtifactId(fromEx.getArtifactId()); exclusions.add(ex); } dependency.setExclusions(exclusions); } return dependency; }
Collection<Exclusion> result = new LinkedHashSet<Exclusion>( dependency.getExclusions() ); result.addAll( exclusions ); management.setExclusions( result );
Collection<Exclusion> result = new LinkedHashSet<Exclusion>( dependency.getExclusions() ); result.addAll( exclusions ); management.setExclusions( result );
public static MavenDependency fromDependency(final Dependency dependency) { final Artifact artifact = dependency.getArtifact(); final PackagingType packaging = PackagingType .of(artifact.getProperty(ArtifactProperties.TYPE, artifact.getExtension())); final String classifier = artifact.getClassifier().length() == 0 ? packaging.getClassifier() : artifact.getClassifier(); final MavenCoordinate coordinate = MavenCoordinates.createCoordinate(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), packaging, classifier); // SHRINKRES-143 lets ignore invalid scope ScopeType scope = ScopeType.RUNTIME; try { scope = ScopeType.fromScopeType(dependency.getScope()); } catch (IllegalArgumentException e) { // let scope be RUNTIME log.log(Level.WARNING, "Invalid scope {0} of dependency {1} will be replaced by <scope>runtime</scope>", new Object[] { dependency.getScope(), coordinate.toCanonicalForm() }); } final MavenDependency result = MavenDependencies.createDependency(coordinate, scope, dependency.isOptional(), fromExclusions(dependency.getExclusions()).toArray(TYPESAFE_EXCLUSIONS_ARRAY)); return result; }
public static MavenDependency fromDependency(final Dependency dependency) { final Artifact artifact = dependency.getArtifact(); final PackagingType packaging = PackagingType .of(artifact.getProperty(ArtifactProperties.TYPE, artifact.getExtension())); final String classifier = artifact.getClassifier().length() == 0 ? packaging.getClassifier() : artifact.getClassifier(); final MavenCoordinate coordinate = MavenCoordinates.createCoordinate(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), packaging, classifier); // SHRINKRES-143 lets ignore invalid scope ScopeType scope = ScopeType.RUNTIME; try { scope = ScopeType.fromScopeType(dependency.getScope()); } catch (IllegalArgumentException e) { // let scope be RUNTIME log.log(Level.WARNING, "Invalid scope {0} of dependency {1} will be replaced by <scope>runtime</scope>", new Object[] { dependency.getScope(), coordinate.toCanonicalForm() }); } final MavenDependency result = MavenDependencies.createDependency(coordinate, scope, dependency.isOptional(), fromExclusions(dependency.getExclusions()).toArray(TYPESAFE_EXCLUSIONS_ARRAY)); return result; }
getLog().debug("Root dependency request trace: " + dependencyRequest.getCollectRequest().getTrace().toString()); getLog().debug("Root dependency exclusions: " + rootDependency.getExclusions()); getLog().debug(LINE_SEPARATOR); if ((downloadOptionalDependencies || !dependencyNode.getDependency().isOptional()) && ! containsEx(parsedExcludedArtifacts, dummyExclusion) && !((rootDependency.getExclusions() != null) && (containsEx(rootDependency.getExclusions(), dummyExclusion)) ) ) { Artifact returnedArtifact = repositorySystem.resolveArtifact(repositorySystemSession, new ArtifactRequest(dependencyNode)).getArtifact();
ex.addAll(parent.getDependency().getExclusions());
@SuppressWarnings("unchecked") public MavenDependencyAdapter(final org.eclipse.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()); if (dep.isOptional()) { this.setOptional(dep.isOptional()); } this.setScope(dep.getScope()); this.setType(dep.getArtifact().getExtension()); this.setVersion(dep.getArtifact().getBaseVersion()); this.artifact = RESOURCE_FACTORY.create(FileResource.class, dep.getArtifact().getFile()); }
premanagedExclusions = dependency.getExclusions(); dependency = dependency.setExclusions( depMngt.getExclusions() ); managedBits |= DependencyNode.MANAGED_EXCLUSIONS;