Search in sources :

Example 1 with ArtifactType

use of org.sonatype.aether.artifact.ArtifactType in project sonatype-aether by sonatype.

the class CachingArtifactTypeRegistry method get.

public ArtifactType get(String typeId) {
    ArtifactType type = types.get(typeId);
    if (type == null) {
        type = delegate.get(typeId);
        types.put(typeId, type);
    }
    return type;
}
Also used : ArtifactType(org.sonatype.aether.artifact.ArtifactType)

Example 2 with ArtifactType

use of org.sonatype.aether.artifact.ArtifactType in project gradle by gradle.

the class AbstractMavenPublishAction method createTypedArtifact.

private Artifact createTypedArtifact(String type, String classifier) {
    String extension = type;
    ArtifactType stereotype = session.getArtifactTypeRegistry().get(type);
    if (stereotype != null) {
        extension = stereotype.getExtension();
        if (classifier == null) {
            classifier = stereotype.getClassifier();
        }
    }
    return new DefaultArtifact(pomArtifact.getGroupId(), pomArtifact.getArtifactId(), classifier, extension, pomArtifact.getVersion());
}
Also used : ArtifactType(org.sonatype.aether.artifact.ArtifactType) DefaultArtifact(org.sonatype.aether.util.artifact.DefaultArtifact)

Aggregations

ArtifactType (org.sonatype.aether.artifact.ArtifactType)2 DefaultArtifact (org.sonatype.aether.util.artifact.DefaultArtifact)1