当前位置: 首页>>代码示例>>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;未经允许,请勿转载。