本文整理汇总了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() );
}
示例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;
}
示例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));
}
示例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());
}
示例5: get
import org.eclipse.aether.artifact.ArtifactType; //导入依赖的package包/类
public ArtifactType get(String stereotypeId) {
ArtifactHandler handler = handlerManager.getArtifactHandler(stereotypeId);
return newArtifactType(stereotypeId, handler);
}