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

Allow more control around the configuration and use of optional dependencies

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 2.0.6
    • None
    • Dependencies
    • None

    Description

      This request is based on the following posting to the users mailing list.

      How can I include a dependency's optional dependency without
      adding the optional dependency to the pom?

      As an example, shale-test has an optional dependency on commons-digester. Since
      my application does not use commons-digester, I do not have it defined as
      a dependency in the pom. When the test that used shale-test failed I had to
      determine the failure was due to a missing dependency that was defined in shale-test's
      pom. Thus the following questions.

      1) Is their a way I can include all of a dependencies optional dependencies
      without knowing what they are?

      <dependency>
      <groupId>org.apache.shale</groupId>
      <artifactId>shale-test</artifactId>
      <version>1.1.0-SNAPSHOT</version>
      <scope>test</scope>
      <includeOptionalDependencies all="true"/> <!-- Just a guess to illustrate the intent -->
      <dependency>

      2) Is their a way I can include selected optional dependencies for a dependency?

      <dependency>
      <groupId>org.apache.shale</groupId>
      <artifactId>shale-test</artifactId>
      <version>1.1.0-SNAPSHOT</version>
      <scope>test</scope>
      <includeOptionalDependencies> <!-- Just a guess to illustrate the intent -->
      <dependency>
      <groupId>commons-digester</groupId>
      <artifactId>commons-digester</artifactId>
      </dependency>
      </includeOptionalDependencies>
      <dependency>

      3) Can optional dependencies be grouped to allow for the inclusion of a
      named group of optional dependencies, thus freeing the user from
      having to know and maintain a list of optional dependencies to
      include?

      <dependency>
      <groupId>org.apache.shale</groupId>
      <artifactId>shale-test</artifactId>
      <version>1.1.0-SNAPSHOT</version>
      <scope>test</scope>
      <includeOptionalDependencies group="FunctionalGroup1"/> <!-- Just a guess to illustrate the intent -->
      <dependency>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              paulsp Paul Spencer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: