1

We are using Maven 3.0.5 and assembly plugin 2.2-beta-3.

When we got a transitive range dependency we got an issue that during compile and assembly stage different versions were resolved (we had version X in manifest in the jar and version Y put into tar.gz assembly package).

Question: Is it possible to avoid duplicate artifact resolution in compile+assembly steps so assembly will use the same artifacts as resolved by compilation?

UPD: Saw the same issue with assembly 2.6, probably will try to build a minimal example for it.

dbf
  • 6,399
  • 2
  • 38
  • 65
  • Any reason why using such an old version of assembly plugin (and of maven as well)? – A_Di-Matteo Jun 08 '16 at 08:51
  • 1
    Use uptodate plugin versions see http://maven.apache.org/plugins/ and use those versions...If you have further issues please mail on the users list or in case you think you found a bug please file in a jira ticket. The current version is 2.6 ! – khmarbaise Jun 08 '16 at 09:04

1 Answers1

1

You are using a really old version of the maven-assembly-plugin, version 2.2-beta-3 is from 2009.

Many similar issues have been resolved since then, just to mention some:

  • MASSEMBLY-448: Assembly plugin's dependency resolution for dependency sets is not inline with maven dependency resolution
  • MASSEMBLY-432: assembly misapplies depMgt and selects the wrong dependency for an archive
  • MASSEMBLY-299: assembly does not honnor <dependencyManagement> directives

So, I would strongly recommend to upgrade it to at least non-beta version, the released 2.2.

A newer version of Maven and a newer version of the assembly plugin would be the ideal solution, but it really depends on your hard constraints on these versioning, if any.

A_Di-Matteo
  • 26,902
  • 7
  • 94
  • 128
  • 2.2 is also very old...don't use such old versions. See my comment above. – khmarbaise Jun 08 '16 at 09:07
  • @A. Di Matteo thanks for suggestion, looks like the issue is with outdated versions so we will try to update it and check again. The remaining question is - do you know is it possible to avoid duplicate resolution by compile/assembly stages? – dbf Jun 08 '16 at 09:11
  • @khmarbaise I agree, as I stated at the bottom of the answer, both maven and plugin should be upgraded, but we don't know why these old versions were used (if any real/hard reason exists), so at least as bare minimal suggestion, I would say don't use beta versions. Then, we are definitely aligned, avoid also using released versions from 2009 and try to push for newer. – A_Di-Matteo Jun 08 '16 at 09:12
  • Sure. The problem is related to many old posts which reference those old versions which are copy&pasted...;-) – khmarbaise Jun 08 '16 at 09:17
  • @dbf the plugin needs to resolve the (transitive) dependencie to pack them in a jar with dependencies, for example, but resolution would be against the local repository anyway (unless bugs for mismatching resolution). check [this SO thread](http://stackoverflow.com/q/10780503/5606016) for similar issue. Solution was to move to `maven-shade-plugin`, which is the recommended approach anyway in most cases. – A_Di-Matteo Jun 08 '16 at 09:46
  • Have the same issue with 2.6, will try to build a small example. – dbf Jun 08 '16 at 09:58