use of org.apache.maven.shared.dependency.graph.DependencyNode in project maven-plugins by apache.
the class DependenciesReport method executeReport.
@Override
public void executeReport(Locale locale) {
if (settings.isOffline() && dependencyLocationsEnabled) {
getLog().warn("The parameter 'dependencyLocationsEnabled' is ignored in offline mode.");
dependencyLocationsEnabled = false;
}
try {
copyResources(new File(getOutputDirectory()));
} catch (IOException e) {
getLog().error("Cannot copy ressources", e);
}
@SuppressWarnings("unchecked") RepositoryUtils repoUtils = new RepositoryUtils(getLog(), wagonManager, settings, mavenProjectBuilder, factory, resolver, project.getRemoteArtifactRepositories(), project.getPluginArtifactRepositories(), localRepository, repositoryMetadataManager);
DependencyNode dependencyNode = resolveProject();
Dependencies dependencies = new Dependencies(project, dependencyNode, classesAnalyzer);
DependenciesReportConfiguration config = new DependenciesReportConfiguration(dependencyDetailsEnabled, dependencyLocationsEnabled);
DependenciesRenderer r = new DependenciesRenderer(getSink(), locale, getI18N(locale), getLog(), settings, dependencies, dependencyNode, config, repoUtils, artifactFactory, mavenProjectBuilder, remoteRepositories, localRepository);
r.render();
}
use of org.apache.maven.shared.dependency.graph.DependencyNode in project maven-plugins by apache.
the class DependenciesReport method canGenerateReport.
// ----------------------------------------------------------------------
// Public methods
// ----------------------------------------------------------------------
@Override
public boolean canGenerateReport() {
boolean result = super.canGenerateReport();
if (result && skipEmptyReport) {
// This seems to be a bit too much but the DependenciesRenderer applies the same logic
DependencyNode dependencyNode = resolveProject();
Dependencies dependencies = new Dependencies(project, dependencyNode, classesAnalyzer);
result = dependencies.hasDependencies();
}
return result;
}
use of org.apache.maven.shared.dependency.graph.DependencyNode in project fabric8 by fabric8io.
the class BuildMojo method collectClassPath.
private ArrayList<Artifact> collectClassPath() throws DependencyGraphBuilderException {
ArtifactFilter filter = new ScopeArtifactFilter(scope);
DependencyNode rootNode = dependencyGraphBuilder.buildDependencyGraph(project, filter);
final ArrayList<Artifact> artifacts = new ArrayList<>();
rootNode.accept(new DependencyNodeVisitor() {
@Override
public boolean visit(DependencyNode dependencyNode) {
artifacts.add(dependencyNode.getArtifact());
return true;
}
@Override
public boolean endVisit(DependencyNode dependencyNode) {
return true;
}
});
return artifacts;
}
Aggregations