当前位置: 首页>>代码示例>>Java>>正文


Java DependencyNode.getArtifact方法代码示例

本文整理汇总了Java中org.eclipse.aether.graph.DependencyNode.getArtifact方法的典型用法代码示例。如果您正苦于以下问题:Java DependencyNode.getArtifact方法的具体用法?Java DependencyNode.getArtifact怎么用?Java DependencyNode.getArtifact使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.aether.graph.DependencyNode的用法示例。


在下文中一共展示了DependencyNode.getArtifact方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRemoteURLs

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private List<URL> getRemoteURLs(final List<DependencyNode> nodes) throws IOException {

        final List<URL> urls = new ArrayList<URL>();
        for (DependencyNode node : nodes) {

            final Artifact artifact = node.getArtifact();
            boolean added = false;

            for (RemoteRepository repository : node.getRepositories()) {
                if (!added) {
                    final URL url = constructRemoteURL(artifact, repository);
                    added |= URLUtils.ping(url, URL_PING_TIMEOUT_MILLIS) && urls.add(url);
                }
            }

            if (!added) { throw new IOException("unable to resolve the remote ural of artifact " + artifact); }
        }
        return urls;
    }
 
开发者ID:stacs-srg,项目名称:shabdiz,代码行数:20,代码来源:MavenDependencyResolver.java

示例2: findVersion

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private String findVersion(List<DependencyNode> dependencies, String groupId, String artifactId)
{
   for (DependencyNode child : dependencies)
   {
      Artifact childArtifact = child.getArtifact();

      if (groupId.equals(childArtifact.getGroupId())
               && artifactId.equals(childArtifact.getArtifactId()))
      {
         return childArtifact.getBaseVersion();
      }
      else
      {
         String version = findVersion(child.getChildren(), groupId, artifactId);
         if (version != null)
         {
            return version;
         }
      }
   }
   return null;
}
 
开发者ID:forge,项目名称:furnace,代码行数:23,代码来源:MavenAddonDependencyResolver.java

示例3: reportMissingDependencies

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private void reportMissingDependencies(PrintStream ps, ListMultimap<Artifact, DependencyNode> artifactNotFoundMap, boolean isBom) {
    ps.print("--- ");
    ps.print(isBom ? BomDependencyNotFoundException.class.getSimpleName() : DependencyNotFoundException.class.getSimpleName());
    ps.print(" (found " + artifactNotFoundMap.keySet().size() + " missing dependencies)");
    ps.println(" ---");
    
    for (Artifact artifact : sortArtifacts(artifactNotFoundMap.keySet())) {
        ps.println("miss: " + artifact);
        List<DependencyNode> roots = sortDependencyNodes(artifactNotFoundMap.get(artifact));
        for (DependencyNode root : roots) {
            ps.println("    from: " + root.getArtifact());
            String path = findPathToDependency(artifact, root);
            String simplePath = root.getArtifact() + " > " + artifact;
            if (isNotEmpty(path) && notEqual(path, simplePath)) {
                ps.print("        path: ");
                ps.print(path);
                ps.println();
            }
        }
    }
    ps.println();
    ps.flush();
}
 
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:24,代码来源:DefaultReporter.java

示例4: processDependencyNode

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private void processDependencyNode(DependencyNode dependencyNode) {
    Artifact artifact = dependencyNode.getArtifact();
    if (!aetherPlugin.getVersionMap().containsKey(artifact.getGroupId()))
        aetherPlugin.getVersionMap().put(artifact.getGroupId(), new HashMap<>());
    aetherPlugin.getVersionMap().get(artifact.getGroupId()).put(artifact.getArtifactId(), artifact.getVersion());
    for (DependencyNode node : dependencyNode.getChildren()) {
        processDependencyNode(node);
    }
}
 
开发者ID:SetoKaiba,项目名称:aether-gradle-plugin,代码行数:10,代码来源:VersionResolverDependencyResolveDetails.java

示例5: processNode

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private ArtifactDescriptor processNode(DependencyNode node,
        Map<DependencyNode, String> resolvedURIs) {
    Artifact dependency = node.getArtifact();
    DefaultArtifactDescriptor artifact = new DefaultArtifactDescriptor(dependency.getGroupId(),
            dependency.getArtifactId(), dependency.getBaseVersion(),
            ArtifactDescriptorFactory.toExtension(dependency.getExtension()),
            ArtifactDescriptorFactory.toScope(node.getDependency().getScope()),
            resolvedURIs.get(node));
    node.getChildren().forEach(d -> artifact.addDependency(processNode(d, resolvedURIs)));
    return artifact;
}
 
开发者ID:atomist-attic,项目名称:rug-resolver,代码行数:12,代码来源:MavenBasedDependencyResolver.java

示例6: accept

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
@Override
public boolean accept(DependencyNode node, List<DependencyNode> parents) {
    Artifact artifact = node.getArtifact();
    String gav = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":"
            + artifact.getExtension() + ":" + artifact.getVersion();
    Optional<String> exclusionMatch = exclusions.stream().filter(e -> matcher.match(e, gav))
            .findAny();
    return !exclusionMatch.isPresent();
}
 
开发者ID:atomist-attic,项目名称:rug-resolver,代码行数:10,代码来源:ExclusionsDependencyFilter.java

示例7: shouldIncludeDependencyNode

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
@Override
boolean shouldIncludeDependencyNode(DependencyNode node, List<DependencyNode> parents) {
    @Nullable Artifact artifact = node.getArtifact();
    return artifact != null
        && (Bundles.ARTIFACT_TYPE.equals(artifact.getExtension()) || JAR_TYPE.equals(artifact.getExtension()))
        && !artifact.getGroupId().equals(BuildInformation.PROJECT_GROUP_ID);
}
 
开发者ID:cloudkeeper-project,项目名称:cloudkeeper,代码行数:8,代码来源:MavenRuntimeContextFactory.java

示例8: createNode

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private DependencyNode createNode(DependencyNode n, Optional<String> extension, Optional<String> classifier) {
    Artifact original = n.getArtifact();
    Artifact withExtension =
            new DefaultArtifact(original.getGroupId(),
                    original.getArtifactId(),
                    classifier.orElse(original.getClassifier()),
                    extension.orElse(original.getExtension()),
                    original.getVersion(),
                    original.getProperties(),
                    (File) null);

    DefaultDependencyNode nodeWithClassifier = new DefaultDependencyNode(new Dependency(withExtension, "system"));

    return nodeWithClassifier;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:16,代码来源:ExtraArtifactsHandler.java

示例9: collectDeps

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
protected void collectDeps(DependencyNode n0, MavenProject p, int depth) {
    getLog().debug("Collecting dependencies of "+n0+"/"+p+" at depth "+depth);
    depNodesByIdCache.put(Coords.of(n0).normal(), n0);
    
    if (n0.getDependency()!=null) {
        if (n0.getDependency().isOptional() && (depth>1 || excludeRootOptionalDependencies)) {
            getLog().warn("Optional dependency found in dependency tree: "+n0);
            return;
        }
        if (!includeScope(n0.getDependency().getScope())) {
            getLog().debug("Skipping "+n0.getDependency().getScope()+" dependency: "+n0);
            return;
        }
    }

    DefaultArtifact n0art = newMavenArtifact(n0.getArtifact());
    if (p==null && n0.getArtifact()!=null) p = loadProject(n0art);
    
    includedBaseArtifactsCoordsToProject.put(Coords.of(n0).baseArtifact(), Coords.of(n0).normal());
    includedProjects.add(Coords.of(n0).normal());
    includedArtifactsUnversionedToBaseArtifactCoords.put(Coords.of(n0).unversionedArtifact(), Coords.of(n0).baseArtifact());
    includedProjectsUnversionedToVersioned.put(Coords.of(n0).unversioned(), Coords.of(n0).normal());
    projectArtifacts.put(Coords.of(n0).normal(), n0art);
    
    if (depth>=this.maxDepth) return;
    
    for (DependencyNode n: n0.getChildren()) {
        projectToDependencyGraphParent.put(Coords.of(n).normal(), Coords.of(n0).normal());
        collectDeps(n, null, depth+1);
    }
}
 
开发者ID:ahgittin,项目名称:license-audit-maven-plugin,代码行数:32,代码来源:AbstractLicensingMojo.java

示例10: visitEnter

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
public boolean visitEnter(final DependencyNode node) {

            final Artifact artifact = node.getArtifact();
            final File artifact_file = artifact.getFile();
            return files.add(artifact_file);
        }
 
开发者ID:stacs-srg,项目名称:shabdiz,代码行数:7,代码来源:MavenDependencyResolver.java

示例11: verify

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private boolean verify(DependencyNode node, RepositorySystemSession session,
        RepositorySystem system, DependencyVerifier... verifiers) {
    List<DependencyVerifier> vs = Arrays.asList(verifiers);
    Artifact na = node.getArtifact();
    boolean result = true;
    if (vs.size() > 0) {
        try {
            raiseEvent(l -> l.starting(na.getGroupId(), na.getArtifactId(), na.getVersion()));

            Artifact signatureArtifact = new DefaultArtifact(node.getArtifact().getGroupId(),
                    node.getArtifact().getArtifactId(), node.getArtifact().getClassifier(),
                    node.getArtifact().getExtension() + ".asc",
                    node.getArtifact().getVersion());
            Artifact pomArtifact = new DefaultArtifact(node.getArtifact().getGroupId(),
                    node.getArtifact().getArtifactId(), node.getArtifact().getClassifier(),
                    "pom", node.getArtifact().getVersion());
            Artifact pomSignatureArtifact = new DefaultArtifact(node.getArtifact().getGroupId(),
                    node.getArtifact().getArtifactId(), node.getArtifact().getClassifier(),
                    "pom.asc", node.getArtifact().getVersion());

            List<ArtifactResult> resolveResult = system.resolveArtifacts(session, Arrays.asList(
                    new ArtifactRequest(node),
                    new ArtifactRequest(signatureArtifact, node.getRepositories(), null),
                    new ArtifactRequest(pomArtifact, node.getRepositories(), null),
                    new ArtifactRequest(pomSignatureArtifact, node.getRepositories(), null)));

            Optional<ArtifactDescriptor> jar = findArtifact("jar", resolveResult);
            Optional<ArtifactDescriptor> asc = findArtifact("jar.asc", resolveResult);
            Optional<ArtifactDescriptor> pom = findArtifact("pom", resolveResult);
            Optional<ArtifactDescriptor> pomAsc = findArtifact("pom.asc", resolveResult);
            
            if (jar.isPresent() && asc.isPresent() && pom.isPresent() && pomAsc.isPresent()) {
                result = !vs.stream()
                        .filter(v -> !v.verify(jar.get(), asc.get(), pom.get(), pomAsc.get()))
                        .findFirst().isPresent();
            }
            else {
                result = false;
            }
            
            if (result) {
                raiseEvent(
                        l -> l.succeeded(na.getGroupId(), na.getArtifactId(), na.getVersion()));
            }
            else {
                raiseEvent(l -> l.failed(na.getGroupId(), na.getArtifactId(), na.getVersion(),
                        null));
            }
        }
        catch (Exception e) {
            result = false;
            raiseEvent(l -> l.failed(na.getGroupId(), na.getArtifactId(), na.getVersion(), e));
            throw new DependencyVerificationFailedException(
                    String.format("Verification of %s:%s (%s) failed",
                            node.getArtifact().getGroupId(), node.getArtifact().getArtifactId(),
                            node.getArtifact().getVersion()),
                    node.getArtifact().getGroupId(), node.getArtifact().getArtifactId(),
                    node.getArtifact().getVersion(), e);
        }
    }
    return result;
}
 
开发者ID:atomist-attic,项目名称:rug-resolver,代码行数:63,代码来源:MavenBasedDependencyResolver.java


注:本文中的org.eclipse.aether.graph.DependencyNode.getArtifact方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。