if (shell.promptBoolean("Dependency is managed [" +
existingDep.getGroupId() + ":" +
existingDep.getArtifactId() + ":" + existingDep.getVersion()
+ "], reference the managed dependency?", true))
{
DependencyBuilder depToAdd = DependencyBuilder.create();
depToAdd.setGroupId(gav.getGroupId());
depToAdd.setArtifactId(gav.getArtifactId());
deps.addDependency(depToAdd);
out.println("Added dependency [" + depToAdd + "]");
requestProcessed = true;
}
}
if (!requestProcessed)
{
DependencyBuilder search = DependencyBuilder.create(gav).setVersion("[0,)");
List<Dependency> availableVersions = deps.resolveAvailableVersions(search);
if (availableVersions.isEmpty())
{
throw new RuntimeException("No available versions resolved for dependency [" + gav + "]");