use of org.commonjava.maven.atlas.graph.rel.SimplePluginDependencyRelationship in project galley by Commonjava.
the class MavenModelProcessor method addPluginDependencies.
private void addPluginDependencies(final Collection<PluginDependencyView> pluginDependencies, final PluginView plugin, final ProjectVersionRef pluginRef, final ProjectVersionRef projectRef, final Builder builder, final URI source, final boolean managed) {
if (pluginDependencies != null) {
for (final PluginDependencyView dep : pluginDependencies) {
try {
final ProjectVersionRef ref = dep.asProjectVersionRef();
final String profileId = dep.getProfileId();
final URI location = RelationshipUtils.profileLocation(profileId);
final ArtifactRef artifactRef = new SimpleArtifactRef(ref, dep.getType(), dep.getClassifier());
// force the InvalidVersionSpecificationException.
artifactRef.getVersionSpec();
boolean inherited = dep.getOriginInfo().isInherited();
boolean mixin = dep.getOriginInfo().isMixin();
builder.withPluginDependencies(new SimplePluginDependencyRelationship(source, location, projectRef, pluginRef, artifactRef, builder.getNextPluginDependencyIndex(pluginRef, managed, inherited), managed, inherited));
} catch (final InvalidRefException e) {
logger.error(String.format("%s: plugin dependency is invalid in: %s! Reason: %s. Skipping:\n\n%s\n\n", projectRef, pluginRef, e.getMessage(), dep.toXML()), e);
} catch (final InvalidVersionSpecificationException e) {
logger.error(String.format("%s: plugin dependency is invalid in: %s! Reason: %s. Skipping:\n\n%s\n\n", projectRef, pluginRef, e.getMessage(), dep.toXML()), e);
} catch (final GalleyMavenException e) {
logger.error(String.format("%s: plugin dependency is invalid in: %s! Reason: %s. Skipping:\n\n%s\n\n", projectRef, pluginRef, e.getMessage(), dep.toXML()), e);
}
}
}
}
Aggregations