public void setDestfile(File file) {
this.destFile = file;
}
public void execute() {
Build build = getBuild();
titleClass(build.getPom().getCoordinates());
Scope [] scopes;
if (scope == null) {
scopes = new Scope[] { Scope.compile, Scope.runtime, Scope.test, Scope.build };
} else {
scopes = new Scope[] { scope };
}
StringBuilder sb = new StringBuilder();
for (Scope scope : scopes) {
Set<Dependency> dependencies = build.getSolver().getDependencies(scope);
if (dependencies.size() == 0) {
continue;
}
sb.append(getConsole().scope(scope, dependencies.size()));
sb.append('\n');
long totalArtifactsSize = 0;
for (Dependency dep : dependencies) {
Pom depPom = build.getSolver().getPom(dep);
File artifact = build.getSolver().getArtifact(dep);
if (artifact != null && artifact.exists()) {
totalArtifactsSize += artifact.length();
}
sb.append(getConsole().dependencyReport(dep, depPom, artifact));
}