maven-assembly-plugin icon indicating copy to clipboard operation
maven-assembly-plugin copied to clipboard

[MASSEMBLY-645] File name of dependency depends on how it is reachable

Open jira-importer opened this issue 12 years ago • 2 comments

Tuure Laurinolli opened MASSEMBLY-645 and commented

Please see demonstration at https://github.com/tazle/maven-issue-demo

After mvn package, the resulting maven-issue-demo-1.0.0-SNAPSHOT-bin.zip contains the following libraries:

maven-issue-demo-1.0.0-SNAPSHOT/lib/httpcore-4.3-alpha2-SNAPSHOT.jar maven-issue-demo-1.0.0-SNAPSHOT/lib/httpclient-4.3-alpha2-20130227.160252-28.jar

For some reason httpcore has a -SNAPSHOT version whereas httpclient has a unique version. This is clearly not desirable, since e.g. the classpath generator in JAR plugin generates either -SNAPSHOT names or unique names but not both.

Some analysis: Originally versions of both libraries are unique. During resolution, some are changed to -SNAPSHOT versions instead. This appears to affect packages that are both direct and transitive dependencies.

Some debug output from a modified assembly plugin, with additional debug output:

[DEBUG] Artifacts before resolution: [DEBUG] artifact: org.apache.httpcomponents:httpcore:jar:4.3-alpha2-SNAPSHOT, version: 4.3-alpha2-20130220.230238-15, base version: 4.3-alpha2-SNAPSHOT, resolved: true, scope: compile [DEBUG] artifact: org.apache.httpcomponents:httpclient:jar:4.3-alpha2-SNAPSHOT, version: 4.3-alpha2-20130227.160252-28, base version: 4.3-alpha2-SNAPSHOT, resolved: true, scope: compile [DEBUG] Resolving project dependencies transitively. [DEBUG] maven-issue-demo:maven-issue-demo:jar:1.0.0-SNAPSHOT (selected for null) [DEBUG] org.apache.httpcomponents:httpcore:jar:4.3-alpha2-SNAPSHOT:compile (selected for compile) [DEBUG] org.apache.httpcomponents:httpclient:jar:4.3-alpha2-SNAPSHOT:compile (selected for compile) [DEBUG] org.apache.httpcomponents:httpcore:jar:4.3-alpha1:compile (removed - nearer found: 4.3-alpha2-SNAPSHOT) [DEBUG] commons-logging:commons-logging:jar:1.1.1:compile (selected for compile) [DEBUG] commons-codec:commons-codec:jar:1.6:compile (selected for compile) [DEBUG] While resolving dependencies of maven-issue-demo:maven-issue-demo:jar:1.0.0-SNAPSHOT: [DEBUG] Statistics for Scope filter [null-scope=true, compile=true, runtime=true, test=false, provided=false, system=false]

[DEBUG] The following scope filters were not used: o Runtime o Test o Provided o System [DEBUG] resolved artifact: org.apache.httpcomponents:httpcore:jar:4.3-alpha2-SNAPSHOT, version: 4.3-alpha2-SNAPSHOT, baseVersion: 4.3-alpha2-SNAPSHOT [DEBUG] resolved artifact: org.apache.httpcomponents:httpclient:jar:4.3-alpha2-SNAPSHOT, version: 4.3-alpha2-20130227.160252-28, baseVersion: 4.3-alpha2-SNAPSHOT [DEBUG] resolved artifact: commons-logging:commons-logging:jar:1.1.1, version: 1.1.1, baseVersion: 1.1.1 [DEBUG] resolved artifact: commons-codec:commons-codec:jar:1.6, version: 1.6, baseVersion: 1.6


Affects: 2.4

Issue Links:

jira-importer avatar Mar 07 '13 05:03 jira-importer