use of org.commonjava.maven.atlas.graph.rel.SimpleExtensionRelationship in project galley by Commonjava.
the class MavenModelProcessor method addExtensionUsages.
private void addExtensionUsages(final URI source, final Builder builder, final MavenPomView pomView, final ProjectVersionRef projectRef) throws GalleyMavenException {
List<ExtensionView> extensions = null;
try {
extensions = pomView.getBuildExtensions();
} catch (final GalleyMavenException e) {
logger.error(String.format("%s: Cannot retrieve build extensions: %s", pomView.getRef(), e.getMessage()), e);
} catch (final InvalidVersionSpecificationException e) {
logger.error(String.format("%s: Cannot retrieve build extensions: %s", pomView.getRef(), e.getMessage()), e);
} catch (final InvalidRefException e) {
logger.error(String.format("%s: Cannot retrieve build extensions: %s", pomView.getRef(), e.getMessage()), e);
}
for (final ExtensionView ext : extensions) {
if (ext == null) {
continue;
}
try {
final ProjectVersionRef ref = ext.asProjectVersionRef();
// force the InvalidVersionSpecificationException.
ref.getVersionSpec();
builder.withExtensions(new SimpleExtensionRelationship(source, projectRef, ref, builder.getNextExtensionIndex(), ext.getOriginInfo().isInherited()));
} catch (final InvalidRefException e) {
logger.error(String.format("%s: Build extension is invalid! Reason: %s. Skipping:\n\n%s\n\n", pomView.getRef(), e.getMessage(), ext.toXML()), e);
} catch (final InvalidVersionSpecificationException e) {
logger.error(String.format("%s: Build extension is invalid! Reason: %s. Skipping:\n\n%s\n\n", pomView.getRef(), e.getMessage(), ext.toXML()), e);
} catch (final GalleyMavenException e) {
logger.error(String.format("%s: Build extension is invalid! Reason: %s. Skipping:\n\n%s\n\n", pomView.getRef(), e.getMessage(), ext.toXML()), e);
}
}
}
Aggregations