use of org.apache.maven.shared.dependencies.collect.CollectorResult in project maven-plugins by apache.
the class ListRepositoriesMojo method doExecute.
/**
* Displays a list of the repositories used by this build.
*
* @throws MojoExecutionException with a message if an error occurs.
*/
@Override
protected void doExecute() throws MojoExecutionException {
try {
CollectorResult collectResult = dependencyCollector.collectDependencies(session.getProjectBuildingRequest(), getProject().getModel());
this.getLog().info("Repositories used by this build:");
for (ArtifactRepository repo : collectResult.getRemoteRepositories()) {
this.getLog().info(repo.toString());
}
} catch (DependencyCollectorException e) {
throw new MojoExecutionException("Unable to resolve artifacts", e);
}
}
Aggregations