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


Java ArtifactType类代码示例

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


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

示例1: dependencyArtifact

import org.eclipse.aether.artifact.ArtifactType; //导入依赖的package包/类
public static Artifact dependencyArtifact( RepositorySystemSession repoSession, Dependency dependency )
{
    ArtifactTypeRegistry registry = ArtifactTypeRegistry.getDefaultRegistry();

    if ( repoSession != null && dependency.getType() != null )
    {
        ArtifactType type = repoSession.getArtifactTypeRegistry().get( dependency.getType() );

        if ( type != null )
        {
            registry =
                registry.registerStereotype( dependency.getType(), type.getExtension(), type.getClassifier() );
        }
    }

    return registry.createTypedArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(),
                                         dependency.getClassifier(), dependency.getVersion() );
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:Utils.java

示例2: resolveArchive

import org.eclipse.aether.artifact.ArtifactType; //导入依赖的package包/类
private boolean resolveArchive(ValidatorContext ctx, File pomFile, Artifact pomArtifact, Model model) {
    if (!model.getPackaging().equals("pom")) {

        ArtifactTypeRegistry artifactTypeRegistry = repositorySystemSession.getArtifactTypeRegistry();
        ArtifactType artifactType = artifactTypeRegistry.get(model.getPackaging());
        
        if (artifactType == null) {
            ctx.addError(this, pomFile, new UnknownArtifactTypeException(model.getPackaging(), relativize(ctx, pomFile)));
            return false;
        }

        Artifact archiveArtifact = new DefaultArtifact(
                pomArtifact.getGroupId(),
                pomArtifact.getArtifactId(),
                artifactType.getClassifier(),
                artifactType.getExtension(),
                pomArtifact.getVersion());

        ArtifactRequest archiveRequest = new ArtifactRequest();
        archiveRequest.setArtifact(archiveArtifact);
        archiveRequest.setRepositories(ctx.getRemoteRepositories());

        try {
            repositorySystem.resolveArtifact(repositorySystemSession, archiveRequest);
        } catch (ArtifactResolutionException e) {
            collectAndReportMissingArtifacts(ctx, e, pomFile, pomArtifact, new DefaultDependencyNode(pomArtifact));
            return false;
        }
    }
    return true;
}
 
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:32,代码来源:DependenciesValidator.java

示例3: availableVersions

import org.eclipse.aether.artifact.ArtifactType; //导入依赖的package包/类
public List<Version> availableVersions(String groupId, String artifactId, ArtifactType type) throws VersionRangeResolutionException {
    return availableVersions(new DefaultArtifact(groupId, artifactId, null, null, "[0,)", type));
}
 
开发者ID:mlhartme,项目名称:maven-embedded,代码行数:4,代码来源:Maven.java

示例4: newArtifactType

import org.eclipse.aether.artifact.ArtifactType; //导入依赖的package包/类
public static ArtifactType newArtifactType(String id, ArtifactHandler handler) {
  return new DefaultArtifactType(id, handler.getExtension(), handler.getClassifier(), handler.getLanguage(), handler.isAddedToClasspath(), handler.isIncludesDependencies());
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:4,代码来源:AetherUtils.java

示例5: get

import org.eclipse.aether.artifact.ArtifactType; //导入依赖的package包/类
public ArtifactType get(String stereotypeId) {
  ArtifactHandler handler = handlerManager.getArtifactHandler(stereotypeId);
  return newArtifactType(stereotypeId, handler);
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:5,代码来源:AetherUtils.java


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