當前位置: 首頁>>代碼示例>>Java>>正文


Java Dependency.getScope方法代碼示例

本文整理匯總了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;
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:20,代碼來源:AddonDependencySelector.java

示例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;
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:23,代碼來源:AddonDependencySelector.java

示例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;
}
 
開發者ID:revapi,項目名稱:revapi,代碼行數:15,代碼來源:ScopeDependencySelector.java

示例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);
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:37,代碼來源:MavenAddonDependencyResolver.java

示例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);
}
 
開發者ID:retog,項目名稱:karaf-maven-plugin,代碼行數:5,代碼來源:Dependency31Helper.java


注:本文中的org.eclipse.aether.graph.Dependency.getScope方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。