本文整理汇总了Java中org.eclipse.aether.graph.Dependency.getScope方法的典型用法代码示例。如果您正苦于以下问题:Java Dependency.getScope方法的具体用法?Java Dependency.getScope怎么用?Java Dependency.getScope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.aether.graph.Dependency
的用法示例。
在下文中一共展示了Dependency.getScope方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectDependency
import org.eclipse.aether.graph.Dependency; //导入方法依赖的package包/类
@Override
public boolean selectDependency(Dependency dependency)
{
boolean result = false;
if (!isExcluded(dependency))
{
boolean module = this.classifier.equals(dependency.getArtifact().getClassifier());
String scope = dependency.getScope();
if (dependency.isOptional() && depth > 1)
result = false;
else if ("test".equals(scope))
result = false;
else
result = (module && depth == 1) || (!module && !"provided".equals(scope));
}
return result;
}
示例2: selectDependency
import org.eclipse.aether.graph.Dependency; //导入方法依赖的package包/类
@Override
public boolean selectDependency(Dependency dependency)
{
boolean result = false;
if (!isExcluded(dependency))
{
boolean optional = dependency.isOptional();
if (depth < 1)
return !optional;
String scope = dependency.getScope();
String classifier = dependency.getArtifact().getClassifier();
if ("test".equals(scope))
return false;
result = (this.classifier.equals(classifier) && depth == 1)
|| (!this.classifier.equals(classifier) && !"provided".equals(scope) && !optional);
}
return result;
}
示例3: hasRequiredScope
import org.eclipse.aether.graph.Dependency; //导入方法依赖的package包/类
private boolean hasRequiredScope(Dependency dep) {
String scope = dep.getScope();
if (scope == null || scope.isEmpty()) {
scope = "compile";
}
for (String s : scopes) {
if (s.equals(scope)) {
return true;
}
}
return false;
}
示例4: fromNode
import org.eclipse.aether.graph.Dependency; //导入方法依赖的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);
}
示例5: selectDependency
import org.eclipse.aether.graph.Dependency; //导入方法依赖的package包/类
public boolean selectDependency(Dependency dependency) {
String scope = dependency.getScope();
return !"test".equals(scope) && !"runtime".equals(scope);
}