public boolean visitEnter( DependencyNode node ) { StringBuilder buffer = new StringBuilder( 128 ); buffer.append( indent ); org.eclipse.aether.graph.Dependency dep = node.getDependency(); if ( dep != null ) { Artifact art = dep.getArtifact(); buffer.append( art ); buffer.append( ':' ).append( dep.getScope() ); } logger.debug( buffer.toString() ); indent += " "; return true; }
@Override public boolean accept(DependencyNode node, List<DependencyNode> parents) { String scope = node.getDependency().getScope(); if (scope != null) { scope = StringUtils.toLowerCase(scope); if ("provided".equals(scope)) { return false; } if ("test".equals(scope)) { return false; } if ("system".equals(scope)) { return false; } } if (accept(node.getArtifact())) { return false; } for (DependencyNode parent : parents) { if (accept(parent.getArtifact())) { return false; } } return true; }
buffer.append( ':' ).append( dep.getScope() );
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; }
Collection<Exclusion> exclusions = dependency != null ? dependency.getExclusions() : null; org.eclipse.aether.graph.Dependency dep = RepositoryUtils.toDependency( artifact, exclusions ); if ( !JavaScopes.SYSTEM.equals( dep.getScope() ) && dep.getArtifact().getFile() != null )
/** * Gets the direct dependencies filter to be used when collecting Container dependencies. If the rootArtifact is a * {@link ArtifactClassificationType#MODULE} it will include {@value org.eclipse.aether.util.artifact.JavaScopes#COMPILE} * dependencies too if not just {@value org.eclipse.aether.util.artifact.JavaScopes#PROVIDED}. * * @param rootArtifactType the {@link ArtifactClassificationType} for rootArtifact * @return {@link Predicate} for selecting direct dependencies for the Container. */ private Predicate<Dependency> getContainerDirectDependenciesFilter(ArtifactClassificationType rootArtifactType) { return rootArtifactType.equals(MODULE) ? directDep -> directDep.getScope().equals(PROVIDED) || directDep.getScope().equals(COMPILE) : directDep -> directDep.getScope().equals(PROVIDED) || directDep.getArtifact().getClassifier().equals(MULE_PLUGIN_CLASSIFIER); }
if ( !JavaScopes.SYSTEM.equals( pluginDep.getScope() ) )
&& dependency.getScope().equals(COMPILE); if (PLUGIN.equals(rootArtifactType)) { logger.debug("rootArtifact '{}' identified as Mule plugin", rootArtifact);
if (toTransform.getScope().equals(TEST) && !MULE_PLUGIN_CLASSIFIER.equals(toTransform.getArtifact().getClassifier())) { if (TESTS_CLASSIFIER.equals(toTransform.getArtifact().getClassifier())) { || MULE_PLUGIN_CLASSIFIER.equals(toTransform.getArtifact().getClassifier()) || MULE_SERVICE_CLASSIFIER.equals(toTransform.getArtifact().getClassifier())) && toTransform.getScope().equals(COMPILE)) { return toTransform.setScope(PROVIDED); if (rootArtifactType == MODULE && toTransform.getScope().equals(COMPILE)) { return toTransform.setScope(PROVIDED); newArrayList(dependencyResolver.readArtifactDescriptor(rootArtifact).getManagedDependencies()); managedDependencies.addAll(directDependencies.stream() .filter(directDependency -> !directDependency.getScope().equals(TEST)) .collect(toList())); logger.debug("Resolving dependency graph for '{}' scope direct dependencies: {} and managed dependencies {}",
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 == null || included.contains( scope ) ) && ( excluded == null || !excluded.contains( scope ) ); }
if ((!"test".equals(dependency2.getScope()) && !dependency2.getArtifact().isSnapshot())) { request.setArtifact(dependency2.getArtifact()); request.setRepositories(mavenPluginRepository.getLocalRepositories());
private Accept accept(DependencyNode dependency, Accept previous) { String scope = dependency.getDependency().getScope(); if (scope == null || "runtime".equalsIgnoreCase(scope) || "compile".equalsIgnoreCase(scope)) { return previous; } if ("provided".equalsIgnoreCase(scope)) { return Accept.PROVIDED; } return Accept.STOP; }
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 ) ); }
@Override public String toString() { return String.valueOf( getArtifact() ) + " (" + getScope() + ( isOptional() ? "?" : "" ) + ")"; }
@Override public String toString() { return String.valueOf( getArtifact() ) + " (" + getScope() + ( isOptional() ? "?" : "" ) + ")"; }
@Override public void selectScope( ConflictContext context ) throws RepositoryException { String scope = context.getWinner().getDependency().getScope(); if ( !JavaScopes.SYSTEM.equals( scope ) ) { scope = chooseEffectiveScope( context.getItems() ); } context.setScope( scope ); }
@Override public void selectScope( ConflictContext context ) throws RepositoryException { String scope = context.getWinner().getDependency().getScope(); if ( !JavaScopes.SYSTEM.equals( scope ) ) { scope = chooseEffectiveScope( context.getItems() ); } context.setScope( scope ); }