Maven WAR Plugin
  1. Maven WAR Plugin
  2. MWAR-220

dependencyManagement && overlay + transitive dependency = multiple versions of same dependency in WEB-INF/lib

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: overlay
    • Labels:
      None
    • Environment:
      Reproduced this on: 2.0.11, 2.1.0, 2.2.1, 3.0-alpha-7

      Description

      With dependencyManagement section defined I get multiple versions of spring libraries in target/cas-*/WEB-INF/lib after mvn package. If I remove the dependencyManagement section then only one version of the spring libraries are found.

      There seems to be a problem with m-war-p and overlays and dependencyManagement not using the maven GAV resolver in a proper way.. I attached a simple pom which exhibits the problem, just run mvn package to verify.

        Activity

        Hide
        Michael Osipov added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.
        Hide
        jieryn added a comment -

        No one has looked at this, but I provided an example which demonstrates the problem. I also just re-tested this with Apache Maven 3.2.3 and it still demonstrates the problem..

        Show
        jieryn added a comment - No one has looked at this, but I provided an example which demonstrates the problem. I also just re-tested this with Apache Maven 3.2.3 and it still demonstrates the problem..
        Hide
        Michael Osipov added a comment -

        Thanks for responding, reopening was the right thing to do.

        Show
        Michael Osipov added a comment - Thanks for responding, reopening was the right thing to do.
        Hide
        Michael Osipov added a comment -

        Note: I had this issue years ago too. The problem is that entire WAR file is taken as artifact. Packed atifacts are mere files. The depenency resolutoin happens here. What you can do is to exclude the conflicting dependencies. This is what I did as a workaround.

        Show
        Michael Osipov added a comment - Note: I had this issue years ago too. The problem is that entire WAR file is taken as artifact. Packed atifacts are mere files. The depenency resolutoin happens here. What you can do is to exclude the conflicting dependencies. This is what I did as a workaround.
        Hide
        Sandra Parsick added a comment -

        Reproducable with Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00) and Maven-War-Plugin version 3.0.0

        Show
        Sandra Parsick added a comment - Reproducable with Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00) and Maven-War-Plugin version 3.0.0
        Hide
        Michael Osipov added a comment -

        This can't and won't work if you take a look how overlays are implemented. WARs are opaque ZIPs files, all operations happen on a file basis and not on artifacts and dependencies. At that point, dependency mediation is long over. A probably good solution would read the POM from the WAR, build the dependency tree, match against current project and produce a new WEB-INF/lib listing. A busload of work. Working with file excludes is the only reasonable workaround for now.

        Show
        Michael Osipov added a comment - This can't and won't work if you take a look how overlays are implemented . WARs are opaque ZIPs files, all operations happen on a file basis and not on artifacts and dependencies. At that point, dependency mediation is long over. A probably good solution would read the POM from the WAR, build the dependency tree, match against current project and produce a new WEB-INF/lib listing. A busload of work. Working with file excludes is the only reasonable workaround for now.

          People

          • Assignee:
            Unassigned
            Reporter:
            jieryn
          • Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:

              Development