in src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java [348:374]
public void copyPoms(File destDir, Set<Artifact> artifacts, boolean removeVersion, boolean removeClassifier)
throws MojoExecutionException {
for (Artifact artifact : artifacts) {
Artifact pomArtifact = getResolvedPomArtifact(artifact);
// Copy the pom
if (pomArtifact != null
&& pomArtifact.getFile() != null
&& pomArtifact.getFile().exists()) {
File pomDestFile = new File(
destDir,
DependencyUtil.getFormattedFileName(
pomArtifact, removeVersion, prependGroupId, useBaseVersion, removeClassifier));
if (!pomDestFile.exists()) {
try {
copyUtil.copyArtifactFile(pomArtifact, pomDestFile);
} catch (IOException e) {
throw new MojoExecutionException(
"Failed to copy artifact '" + pomArtifact + "' (" + pomArtifact.getFile() + ") to "
+ pomDestFile,
e);
}
}
}
}
}