in src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java [109:138]
protected void doExecute() throws MojoExecutionException {
DependencyStatusSets dss = getDependencySets(this.failOnMissingClassifierArtifact, addParentPoms);
Set<Artifact> artifacts = dss.getResolvedDependencies();
if (!useRepositoryLayout) {
for (Artifact artifact : artifacts) {
copyArtifact(
artifact, isStripVersion(), this.prependGroupId, this.useBaseVersion, this.stripClassifier);
}
} else {
ProjectBuildingRequest buildingRequest = getRepositoryManager()
.setLocalRepositoryBasedir(session.getProjectBuildingRequest(), outputDirectory);
artifacts.forEach(artifact -> installArtifact(artifact, buildingRequest));
}
Set<Artifact> skippedArtifacts = dss.getSkippedDependencies();
for (Artifact artifact : skippedArtifacts) {
getLog().info(artifact.getId() + " already exists in destination.");
}
if (isCopyPom() && !useRepositoryLayout) {
copyPoms(getOutputDirectory(), artifacts, this.stripVersion);
copyPoms(getOutputDirectory(), skippedArtifacts, this.stripVersion, this.stripClassifier); // Artifacts
// that already
// exist may
// not yet have
// poms
}
}