public static Artifact asArtifact(MavenCoordinate coordinate, ArtifactTypeRegistry registry) throws CoordinateParseException {
try {
return new DefaultArtifact(coordinate.getGroupId(), coordinate.getArtifactId(),
coordinate.getClassifier(), coordinate.getPackaging().getExtension(), coordinate.getVersion(), registry.get(coordinate.getPackaging().getId()));
} catch (IllegalArgumentException e) {
throw new CoordinateParseException("Unable to create artifact from invalid coordinates "
+ coordinate.toCanonicalForm());
}
}