[ https://issues.apache.org/jira/browse/MDEP-776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17896823#comment-17896823 ]
Andreas Sewe commented on MDEP-776: ----------------------------------- {quote}You could use prependGroupId to disambuguate. {quote} Yes, there are workarounds, e.g., {{useRepositoryLayout}} as proposed by the OP. However, sometimes you want to use {{copy-dependencies}} or {{unpack-dependencies}} to create a specific directory structure. In that case, a simple *warning* that the structure you want is not possible because of name clashes would make debugging much easier. {quote}I wonder if it would make sense to mangle the names a bit if there are two artifacts with different group IDs but same artifact ID? {quote} Please don't introduce any complex name mangling, in particular not if predicated on some condition like there being clashing names. Oftentimes, you want a specific file and directory structure for further processing/repackaging, and anything the structure produced by {{copy-dependencies}} less predictable is problematic, IMHO. > copy-dependencies overwrites artifacts of the same artifact id > -------------------------------------------------------------- > > Key: MDEP-776 > URL: https://issues.apache.org/jira/browse/MDEP-776 > Project: Maven Dependency Plugin > Issue Type: Bug > Components: copy-dependencies > Affects Versions: 3.1.2, 3.2.0 > Reporter: Nikolaos Georgiou > Assignee: Elliotte Rusty Harold > Priority: Major > > We have a project which has 2 dependencies of different groupId but same > artifactId and version, e.g. com.acme:foo:1.2.3 and com.ecorp:foo:1.2.3 > We use the copy-dependencies goal of the plugin to copy libraries under > target/lib folder. > Actual Result: > * only one foo.jar survives in the target/lib folder. The other one silently > gets overwritten. This leads to difficult to diagnose runtime errors, as one > JAR is missing. > > Expected Result: > * it should at least give a warning, if not an error, that it has > overwritten an artifact during this process > > Known workaround: > * we activated useRepositoryLayout, which allows both artifacts to survive > under a directory structure, which complicates a bit our classpath building > process (from target/lib/* we need to find all the JARs with a bit of bash > glue) > -- This message was sent by Atlassian Jira (v8.20.10#820010)