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

"Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.2
    • None
    • Dependencies
    • None

    Description

      Why are provided scope dependencies not transitive?

      I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.

      At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.

      If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.

      I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.

      E.g.

      <dependencies>
      <dependency>
      <groupId>SalesStation</groupId>
      <artifactId>cds_ss_shared</artifactId>
      <version>SNAPSHOT</version>
      <exclusions>
      <exclusion>
      <groupId>SalesStation</groupId>
      <artifactId>ss_base_shared</artifactId>
      <!-- I want to be able to do this: -->
      <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
      </exclusion>
      </exclusions>
      </dependency>
      </dependencies>

      Attachments

        Issue Links

          Activity

            People

              carlos Carlos Sanchez Gonzalez
              daveboden David Boden
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: