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

A way to replace a transitive dependency

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 3.3.3
    • None
    • Dependencies
    • None
    • all

    Description

      we need a way to replace a transitive dependency. It is needed because the dependency:analyze will throw a warning if you exclude the transitive dependency and declare another dependency to replace the transitive dependency. For example:

      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-tools</artifactId>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>freemarker</groupId>
            <artifactId>freemarker</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
      </dependency>
      

      this will cause dependency:analyze to throw a warning on the org.freemarker:freemarker dependency because it's unused.

      possible sollution:

      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-tools</artifactId>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>freemarker</groupId>
            <artifactId>freemarker</artifactId>
          </exclusion>
        </exclusions>
        <inclusions>
          <inclusion>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
          </inclusion>
        </inclusions>
      </dependency>
      

      org.freemarker:freemarker can now be marked as transitive. It would also be nice to be able to replace a transitive dependency with more than 1 dependency.

      Attachments

        Activity

          People

            rfscholte Robert Scholte
            henryhoen Henry Hoendervangers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: