use of org.eclipse.aether.resolution.DependencyResolutionException in project fabric8 by jboss-fuse.
the class AetherBasedResolver method resolveDependencies.
protected DependencyNode resolveDependencies(RepositorySystemSession session, List<RemoteRepository> repos, DependencyNode pomNode, Dependency dependency, final Filter<Dependency> shouldExclude) throws FailedToResolveDependency {
if (!DependencyFilters.matches(dependency, shouldExclude)) {
CollectRequest cr = new CollectRequest(dependency, repos);
// request.setRequestContext("runtime");
try {
DependencyNode node = m_repoSystem.collectDependencies(session, cr).getRoot();
DependencyFilter filter = new DependencyFilter() {
public boolean accept(DependencyNode node, List<DependencyNode> parents) {
return !DependencyFilters.matches(node, shouldExclude);
}
};
DependencyRequest request = new DependencyRequest(cr, filter);
m_repoSystem.resolveDependencies(session, request);
return node;
} catch (DependencyResolutionException | DependencyCollectionException e) {
handleDependencyResolveFailure(pomNode, dependency, e);
}
}
return null;
}
use of org.eclipse.aether.resolution.DependencyResolutionException in project spf4j by zolyfarkas.
the class ApiChangesMojo method execute.
@Override
public void execute() throws MojoExecutionException {
MavenProject mavenProject = getMavenProject();
try {
getLog().info("Executing JDiff javadoc doclet");
JDiffRunner runner = new JDiffRunner(getMojoExecution(), getToolchainManager(), getMavenSession(), getProjectRepos(), getRepoSystem(), getJavadocExecutable());
runner.runDiffBetweenReleases(mavenProject.getGroupId(), mavenProject.getArtifactId(), this.versionRange, destDir, maxNumberOfDiffs);
runner.writeChangesIndexHtml(destDir, "changes.html");
getLog().info("Generated " + destDir + File.separatorChar + "changes.html");
} catch (IOException | DependencyResolutionException | VersionRangeResolutionException | ArtifactResolutionException | JavadocExecutionException ex) {
throw new MojoExecutionException("Failed executing mojo " + this, ex);
}
}
use of org.eclipse.aether.resolution.DependencyResolutionException in project mule by mulesoft.
the class DependencyResolver method logUnresolvedArtifacts.
/**
* Logs the paths for each dependency not found
*
* @param node root {@link DependencyNode}, can be a "null" root (imaginary root)
* @param e {@link DependencyResolutionException} the error to collect paths.
*/
private void logUnresolvedArtifacts(DependencyNode node, DependencyResolutionException e) {
List<ArtifactResult> artifactResults = e.getResult().getArtifactResults().stream().filter(artifactResult -> !artifactResult.getExceptions().isEmpty()).collect(toList());
final List<String> patternInclusion = artifactResults.stream().map(artifactResult -> toId(artifactResult.getRequest().getArtifact())).collect(toList());
PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor(new PatternInclusionsDependencyFilter(patternInclusion), node.getArtifact() != null);
node.accept(visitor);
visitor.getPaths().stream().forEach(path -> {
List<DependencyNode> unresolvedArtifactPath = path.stream().filter(dependencyNode -> dependencyNode.getArtifact() != null).collect(toList());
if (!unresolvedArtifactPath.isEmpty()) {
logger.warn("Dependency path to not resolved artifacts -> {}", unresolvedArtifactPath.toString());
}
});
}
use of org.eclipse.aether.resolution.DependencyResolutionException in project pinpoint by naver.
the class PinpointPluginTestSuite method createSharedCasesWithDependencies.
private List<PinpointPluginTestInstance> createSharedCasesWithDependencies(PluginTestContext context) throws ArtifactResolutionException, DependencyResolutionException {
DependencyResolver resolver = getDependencyResolver(this.repositories);
Map<String, List<Artifact>> dependencyMap = resolver.resolveDependencySets(dependencies);
if (logger.isDebugEnabled()) {
for (Map.Entry<String, List<Artifact>> entry : dependencyMap.entrySet()) {
logger.debug("{} {}", entry.getKey(), entry.getValue());
}
}
List<PinpointPluginTestInstance> cases = new ArrayList<>();
SharedProcessManager sharedProcessManager = new SharedProcessManager(context);
for (Map.Entry<String, List<Artifact>> artifactEntry : dependencyMap.entrySet()) {
final String testId = artifactEntry.getKey();
final List<Artifact> artifacts = artifactEntry.getValue();
List<String> libs = null;
try {
libs = resolveArtifactsAndDependencies(resolver, artifacts);
} catch (DependencyResolutionException e) {
// TODO Skip when running the test
logger.warn(e, "resolveArtifactsAndDependencies failed testId={}", testId);
continue;
}
PinpointPluginTestInstance testInstance = newSharedProcessPluginTestCase(context, testId, libs, sharedProcessManager);
cases.add(testInstance);
sharedProcessManager.registerTest(testInstance.getTestId(), artifacts);
}
return cases;
}
Aggregations