本文整理汇总了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);
}
};
}
示例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);
}
示例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);
}
示例4: deriveChildSelector
import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
return context.getDependency().isOptional() ? DependencySelectors.OMIT_ALL_SELECTOR : this;
}
示例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;
}
示例6: deriveChildTraverser
import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencyTraverser deriveChildTraverser(DependencyCollectionContext context) {
return this;
}
示例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);
}
示例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);
}
示例9: deriveChildTraverser
import org.eclipse.aether.collection.DependencyCollectionContext; //导入依赖的package包/类
@Override
public DependencyTraverser deriveChildTraverser(DependencyCollectionContext context)
{
return this;
}
示例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);
}