当前位置: 首页>>代码示例>>Java>>正文


Java DependencyCollectionContext类代码示例

本文整理汇总了Java中org.eclipse.aether.collection.DependencyCollectionContext的典型用法代码示例。如果您正苦于以下问题:Java DependencyCollectionContext类的具体用法?Java DependencyCollectionContext怎么用?Java DependencyCollectionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DependencyCollectionContext类属于org.eclipse.aether.collection包,在下文中一共展示了DependencyCollectionContext类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newRootScopeDependencySelector

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
private DependencySelector newRootScopeDependencySelector(final DependencySelector base, final int depth) {
    return new DependencySelector() {
        public boolean selectDependency(org.eclipse.aether.graph.Dependency dependency) {
            // use these root scopes
            return includeScope(dependency.getScope()) && (!dependency.isOptional() || !excludeRootOptionalDependencies);
        }
        public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
            // scope is applied to root, thereafter we revert to the base scopes
            if (depth<1)
                return newRootScopeDependencySelector( base.deriveChildSelector(context), depth+1 );
            else
                return base.deriveChildSelector(context);
        }
    };
}
 
开发者ID:ahgittin,项目名称:license-audit-maven-plugin,代码行数:16,代码来源:AbstractLicensingMojo.java

示例2: deriveChildSelector

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencySelector deriveChildSelector(DependencyCollectionContext context)
{
   boolean module = this.classifier.equals(context.getDependency().getArtifact().getClassifier());
   if ((depth > 0) && module)
   {
      return new StaticDependencySelector(false);
   }
   return new AddonDependencySelector(this, context.getDependency(), this.classifier, depth + 1);
}
 
开发者ID:forge,项目名称:furnace,代码行数:11,代码来源:AddonDependencySelector.java

示例3: deriveChildSelector

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencySelector deriveChildSelector(DependencyCollectionContext context)
{
   if ((depth > 0) && this.classifier.equals(context.getDependency().getArtifact().getClassifier()))
   {
      return new StaticDependencySelector(false);
   }
   return new AddonDependencySelector(this.classifier, context.getDependency(), this, depth + 1);
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:10,代码来源:AddonDependencySelector.java

示例4: deriveChildSelector

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
    return context.getDependency().isOptional() ? DependencySelectors.OMIT_ALL_SELECTOR : this;
}
 
开发者ID:MCCityVille,项目名称:libmanager,代码行数:5,代码来源:DeepOptionalDependencySelector.java

示例5: deriveChildSelector

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
    return isCompileScope(context.getDependency().getScope()) ? this : DependencySelectors.OMIT_ALL_SELECTOR;
}
 
开发者ID:MCCityVille,项目名称:libmanager,代码行数:5,代码来源:CompileScopeDependencySelector.java

示例6: deriveChildTraverser

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencyTraverser deriveChildTraverser(DependencyCollectionContext context) {
    return this;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:5,代码来源:RepositorySystemSessionWrapper.java

示例7: deriveChildSelector

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public org.eclipse.aether.collection.DependencySelector deriveChildSelector(DependencyCollectionContext context) {
    return new ScopeDependencySelector(scopes, context.getDependency(), this, depth + 1);
}
 
开发者ID:revapi,项目名称:revapi,代码行数:5,代码来源:ScopeDependencySelector.java

示例8: resolveAPIVersion

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
private Response<String> resolveAPIVersion(AddonId addonId, RepositorySystem system, Settings settings,
         DefaultRepositorySystemSession session)
{
   List<RemoteRepository> repositories = MavenRepositories.getRemoteRepositories(container, settings);
   String mavenCoords = toMavenCoords(addonId);
   Artifact queryArtifact = new DefaultArtifact(mavenCoords);

   session.setDependencyTraverser(new AddonDependencyTraverser(classifier));
   session.setDependencySelector(new DependencySelector()
   {

      @Override
      public boolean selectDependency(Dependency dependency)
      {
         Artifact artifact = dependency.getArtifact();
         if (isAddon(artifact))
         {
            return true;
         }
         return isFurnaceAPI(artifact);
      }

      @Override
      public DependencySelector deriveChildSelector(DependencyCollectionContext context)
      {
         return this;
      }
   });
   CollectRequest request = new CollectRequest(new Dependency(queryArtifact, null), repositories);
   CollectResult result;
   try
   {
      result = system.collectDependencies(session, request);
   }
   catch (DependencyCollectionException e)
   {
      throw new RuntimeException(e);
   }
   List<Exception> exceptions = result.getExceptions();
   String apiVersion = findVersion(result.getRoot().getChildren(), FURNACE_API_GROUP_ID, FURNACE_API_ARTIFACT_ID);
   return new MavenResponseBuilder<String>(apiVersion).setExceptions(exceptions);
}
 
开发者ID:forge,项目名称:furnace,代码行数:43,代码来源:MavenAddonDependencyResolver.java

示例9: deriveChildTraverser

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencyTraverser deriveChildTraverser(DependencyCollectionContext context)
{
   return this;
}
 
开发者ID:forge,项目名称:furnace,代码行数:6,代码来源:AddonDependencyTraverser.java

示例10: deriveChildSelector

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
    if (depth >= 1) {
        return this;
    }
    return new DepthOneOptionalDependencySelector(depth + 1);
}
 
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:7,代码来源:DepthOneOptionalDependencySelector.java

示例11: resolveAPIVersion

import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public Response<String> resolveAPIVersion(AddonId addonId)
{
   RepositorySystem system = container.getRepositorySystem();
   Settings settings = getSettings();
   DefaultRepositorySystemSession session = container.setupRepoSession(system, settings);
   List<RemoteRepository> repositories = MavenRepositories.getRemoteRepositories(container, settings);
   String mavenCoords = toMavenCoords(addonId);
   Artifact queryArtifact = new DefaultArtifact(mavenCoords);

   session.setDependencyTraverser(new AddonDependencyTraverser(classifier));
   session.setDependencySelector(new DependencySelector()
   {

      @Override
      public boolean selectDependency(Dependency dependency)
      {
         Artifact artifact = dependency.getArtifact();
         if (classifier.equals(artifact.getClassifier()))
         {
            return true;
         }
         return (FURNACE_API_GROUP_ID.equals(artifact.getGroupId()) && FURNACE_API_ARTIFACT_ID.equals(artifact
                  .getArtifactId()));
      }

      @Override
      public DependencySelector deriveChildSelector(DependencyCollectionContext context)
      {
         return this;
      }
   });
   CollectRequest request = new CollectRequest(new Dependency(queryArtifact, null), repositories);
   CollectResult result;
   try
   {
      result = system.collectDependencies(session, request);
   }
   catch (DependencyCollectionException e)
   {
      throw new RuntimeException(e);
   }
   List<Exception> exceptions = result.getExceptions();
   String apiVersion = findVersion(result.getRoot().getChildren(), FURNACE_API_GROUP_ID, FURNACE_API_ARTIFACT_ID);
   return new MavenResponseBuilder<String>(apiVersion).setExceptions(exceptions);
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:47,代码来源:MavenAddonDependencyResolver.java


注:本文中的org.eclipse.aether.collection.DependencyCollectionContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。