本文整理汇总了Java中org.eclipse.aether.graph.DependencyNode.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java DependencyNode.getChildren方法的具体用法?Java DependencyNode.getChildren怎么用?Java DependencyNode.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.aether.graph.DependencyNode
的用法示例。
在下文中一共展示了DependencyNode.getChildren方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitEnter
import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
@Override
public boolean visitEnter(DependencyNode dependencyNode) {
if (dependencyNode == null || dependencyNode.getDependency().isOptional()) {
return false;
}
MavenJarRule rule = getRule(dependencyNode);
boolean isFirstVisit = visited.add(rule);
if (!isFirstVisit) {
return false;
}
for (DependencyNode child : dependencyNode.getChildren()) {
MavenJarRule childRule = getRule(child);
ruleGraph.putEdge(rule, childRule);
}
return true;
}
示例2: 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);
}
}
示例3: 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);
}
}
示例4: scan
import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
public void scan(DependencyNode rootNode, boolean useTransitiveDependencies) throws MojoExecutionException {
for (DependencyNode child : rootNode.getChildren()) {
scan(child, Accept.ACCEPT, useTransitiveDependencies, false, "");
}
if (useTransitiveDependencies) {
localDependencies.keySet().removeAll(dependencies);
}
}
示例5: fromNode
import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private AddonInfo fromNode(AddonId id, DependencyNode dependencyNode, RepositorySystem system, Settings settings,
DefaultRepositorySystemSession session)
{
AddonInfoBuilder builder = AddonInfoBuilder.from(id);
List<DependencyNode> children = dependencyNode.getChildren();
for (DependencyNode child : children)
{
Dependency dependency = child.getDependency();
Artifact artifact = dependency.getArtifact();
if (isAddon(artifact))
{
AddonId childId = toAddonId(artifact);
boolean exported = false;
boolean optional = dependency.isOptional();
String scope = dependency.getScope();
if (scope != null && !optional)
{
if ("compile".equalsIgnoreCase(scope) || "runtime".equalsIgnoreCase(scope))
exported = true;
else if ("provided".equalsIgnoreCase(scope))
exported = false;
}
DependencyNode node = traverseAddonGraph(toMavenCoords(childId), system, settings, session);
AddonInfo addonInfo = fromNode(childId, node, system, settings, session);
if (optional)
{
builder.addOptionalDependency(addonInfo, exported);
}
else
{
builder.addRequiredDependency(addonInfo, exported);
}
}
}
return new LazyAddonInfo(this, builder);
}
示例6: NodeClassLoader
import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected NodeClassLoader(BootClassLoader bootClassLoader, DependencyNode node) throws Exception {
this.bootClassLoader = bootClassLoader;
synchronized (NodeClassLoader.class) {
this.nodeClassLoaderId = Long.valueOf(classLoaderId++);
}
this.node = node;
this.artifactId = node.getArtifact().toString();
this.bootClassLoader.addNodeClassLoader(this);
this.depdendenciesNodeClassLoaders = Collections.synchronizedMap(new LinkedHashMap<String, NodeClassLoader>());
this.dependenciesNodeClassLoadersArray = new NodeClassLoader [0];
this.parentNodeClassLoaders = new Vector<NodeClassLoader>();
this.classes = new Hashtable<String, Class<?>>();
if (classesField != null) {
this.jvmClasses = (List<Class<?>>)classesField.get(this);
}
if (log.isDebugEnabled()) {
log.debug("Creating classloader " + this);
}
initArtifactFiles();
//building the dependencies/children
List<DependencyNode> children=node.getChildren();
if (children!=null){
for (DependencyNode n : children){
if (n.getDependency().getArtifact().getFile()!=null){
NodeClassLoader nodeClassLoader = bootClassLoader.getNodeClassLoader(n.getDependency().getArtifact().toString());
if (nodeClassLoader==null) {
nodeClassLoader = new NodeClassLoader(this.bootClassLoader, n);
}
addChild(nodeClassLoader);
} else {
if (log.isDebugEnabled()) {
log.debug("Dependency " + n.getDependency().getArtifact() + " is excluded from classloader " + this);
}
}
}
}
}
示例7: dump
import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
private void dump(String prefix, DependencyNode n) {
getLog().debug(prefix+n+": "+n.getDependency()+" / "+n.getArtifact());
for (DependencyNode nn: n.getChildren())
dump(prefix+" ", nn);
}