Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4690

Transitive dependency lost when included another dependency

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0-beta-3
    • Component/s: Dependencies
    • Labels:
      None
    • Environment:
      maven 2.0.10 (tried with dependency plugin 2.0 and 2.1)

      Description

      We added a new dependency (velocity-tools) and the project didn't work any more. We've found that one transitive library (antlr used by struts and hibernate) is missing in the installed WAR file.

      It looks like the antlr transitive dependency is ignored from hibernate dependencies by plugin choosing struts-1.2.9 one while eventually struts is replaced by 1.2.7 version which does not have antlr dependency.

      There is a workaround to the problem - dependencies might be rearranged to include the missing library back (e.g. by moving struts-1.2.7 from parent to ui but only before velocity-tools - see the test case) however the problem is that the plugin behavior is unpredictable.

      Test case:
      There are root, parent, common, model, ui POM files. The purpose is to create dependency tree deep enough (ui depends on model and inherits from parent, model depends on common). They include external dependencies (velocity-tools, struts, hibernate).

      • WAR artifact created from the root or ui POM does not contain antlr in WEB-INF/lib which is required by hibernate
      • after removing velocity-tools from ui/pom.xml antlr library is included properly

        Attachments

        1. test.zip
          3 kB
          Michal Ropka
        2. test2.zip
          24 kB
          Michal Ropka

          Issue Links

            Activity

              People

              • Assignee:
                bentmann Benjamin Bentmann
                Reporter:
                mropka Michal Ropka
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: