use of org.eclipse.aether.repository.NoLocalRepositoryManagerException in project spring-cloud-function by spring-cloud.
the class DependencyResolutionModule method dependencies.
public List<Dependency> dependencies(final Resource resource, final Properties properties) {
initialize();
try {
ProjectBuildingRequest request = getProjectBuildingRequest(properties);
request.setResolveDependencies(true);
synchronized (DependencyResolver.class) {
ProjectBuildingResult result = projectBuilder.build(new PropertiesModelSource(properties, resource), request);
DependencyResolver.globals = null;
DependencyResolutionResult dependencies = result.getDependencyResolutionResult();
if (!dependencies.getUnresolvedDependencies().isEmpty()) {
StringBuilder builder = new StringBuilder();
for (Dependency dependency : dependencies.getUnresolvedDependencies()) {
List<Exception> errors = dependencies.getResolutionErrors(dependency);
for (Exception exception : errors) {
if (builder.length() > 0) {
builder.append("\n");
}
builder.append(exception.getMessage());
}
}
throw new RuntimeException(builder.toString());
}
return runtime(dependencies.getDependencies());
}
} catch (ProjectBuildingException | NoLocalRepositoryManagerException e) {
throw new IllegalStateException("Cannot build model", e);
}
}
Aggregations