use of org.sonatype.aether.test.util.impl.TestDependencyNode in project sonatype-aether by sonatype.
the class NodeBuilder method build.
public DependencyNode build() {
Dependency dependency = null;
TestDependencyNode node = new TestDependencyNode();
if (artifactId != null && artifactId.length() > 0) {
Artifact artifact = new StubArtifact(groupId, artifactId, classifier, ext, version, properties);
dependency = new Dependency(artifact, scope, optional);
node.setDependency(dependency);
try {
node.setVersion(versionScheme.parseVersion(version));
node.setVersionConstraint(versionScheme.parseVersionConstraint(range != null ? range : version));
} catch (InvalidVersionSpecificationException e) {
throw new IllegalArgumentException("bad version: " + e.getMessage(), e);
}
}
node.setRequestContext(context);
node.setRelocations(relocations);
return node;
}
Aggregations