Maven
  1. Maven
  2. MNG-1991

Can't get transitive dependencies from a war pom when this war is added as a depdency of a project

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0.2
    • Fix Version/s: None
    • Component/s: Dependencies
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      1

      Description

      I have a project (continuum-core-it) that need to use all transitive dependencies of a war (continuum-webapp). If i add the war as a dependency of the project with packaging war, war dependencies aren't shown by project, maven doesn't try to resolve them and doesn't add them in classpath.
      If if replace packaging from war to pom, all dependencies are resolved and added to classpath.

        Issue Links

          Activity

          Hide
          Maarten Billemont added a comment -

          I've created a separate issue for the overlay case, since the resolution for that will probably be different from resolving the skinny WAR use case, and shouldn't need any additional configuration. See MWAR-253

          Show
          Maarten Billemont added a comment - I've created a separate issue for the overlay case, since the resolution for that will probably be different from resolving the skinny WAR use case, and shouldn't need any additional configuration. See MWAR-253
          Show
          Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014
          Hide
          Jason van Zyl 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
          Jason van Zyl 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
          Shane StClair added a comment -

          Comment duplicated on MWAR-253, but example project is also relevant here so I'll cross-post.

          Example project attached (also at https://github.com/srstclair/war-deps) shows the current behavior, meaning that transitive dependencies of the war dependency are not available on the classpath (the war-deps-via-war module's tests fail). I agree that transitive dependencies should be resolved for war dependencies.

          Currently the best workaround I can come up with is to declare a second dependency on the war's pom, which does add transitive dependencies to the classpath (see war-deps-overlay). Is that the recommended approach?

          Show
          Shane StClair added a comment - Comment duplicated on MWAR-253 , but example project is also relevant here so I'll cross-post. Example project attached (also at https://github.com/srstclair/war-deps ) shows the current behavior, meaning that transitive dependencies of the war dependency are not available on the classpath (the war-deps-via-war module's tests fail). I agree that transitive dependencies should be resolved for war dependencies. Currently the best workaround I can come up with is to declare a second dependency on the war's pom, which does add transitive dependencies to the classpath (see war-deps-overlay). Is that the recommended approach?
          Hide
          Paul Benedict added a comment -

          Yes, that's how I have seen it done. You add the "war" to get the artifact and the war's "pom" to get its dependencies.

          Show
          Paul Benedict added a comment - Yes, that's how I have seen it done. You add the "war" to get the artifact and the war's "pom" to get its dependencies.

            People

            • Assignee:
              Unassigned
              Reporter:
              Emmanuel Venisse
            • Votes:
              28 Vote for this issue
              Watchers:
              27 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: