本文整理匯總了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);
}