[
https://issues.apache.org/jira/browse/MDEP-976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17950238#comment-17950238
]
ASF GitHub Bot commented on MDEP-976:
-------------------------------------
elharo commented on code in PR #523:
URL:
https://github.com/apache/maven-dependency-plugin/pull/523#discussion_r2079473159
##########
src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java:
##########
@@ -105,6 +105,15 @@ public class CopyDependenciesMojo extends
AbstractFromDependenciesMojo {
@Parameter(property = "mdep.copySignatures", defaultValue = "false")
protected boolean copySignatures;
+ /**
+ * Prepend the groupId to the output filename by default to avoid
conflicts when artifactIds are not globally unique.
+ * Set to false to retain the original behavior.
Review Comment:
It might be unclear to readers what the original behavior was.
##########
src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java:
##########
@@ -144,25 +153,27 @@ protected void doExecute() throws MojoExecutionException {
DependencyStatusSets dss =
getDependencySets(this.failOnMissingClassifierArtifact, addParentPoms);
Set<Artifact> artifacts = dss.getResolvedDependencies();
+ boolean effectivePrependGroupId = prependGroupId ||
prependGroupIdByDefault;
Review Comment:
why do we need both? One feels like it should be enough
> artifactId is not guaranteed to be globally unique
> --------------------------------------------------
>
> Key: MDEP-976
> URL: https://issues.apache.org/jira/browse/MDEP-976
> Project: Maven Dependency Plugin
> Issue Type: Bug
> Components: copy-dependencies
> Affects Versions: 3.8.1
> Reporter: Gili
> Priority: Major
>
> The copy-dependencies Mojo incorrectly assumes that a dependency's artifactId
> is globally unique. If a project depends on two different groupIds that
> happen to have the same artifactId then one dependency will overwrite the
> other.
> Consider adding ${groupId} to the default output filename and/or add an
> option for doing so in case users wish to retain backwards compatibility.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)