Uploaded image for project: 'Maven Shade Plugin'
  1. Maven Shade Plugin
  2. MSHADE-311

Bad exclusions in dependency-reduced-pom.xml

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Done
    • 3.2.1
    • 3.2.2
    • None
    • maven-shade-plugin 3.2.1
      Maven 3.6.0
      JDK 11

    Description

      Given the following dependency graph:

      test:foo:jar:1.0.0-SNAPSHOT
      +- test:foz:jar:1.0.0-SNAPSHOT:compile
      \- test:bar:jar:1.0.0-SNAPSHOT:provided
         \- test:baz:jar:1.0.0-SNAPSHOT:provided
      

      where baz is a compile scope dependency of bar (and therefore a provided scope dependency of foo). And given the following maven-shade-plugin configuration in foo:

      <configuration>
        <artifactSet>
          <includes>
            <include>test:foz</include>
          </includes>
        </artifactSet>
      </configuration>
      

      A weird dependency-reduced-pom.xml file is produced for foo, where the bar dependency declaration gets an exclusion for baz:

      <dependencies>
        <dependency>
          <groupId>test</groupId>
          <artifactId>bar</artifactId>
          <version>1.0.0-SNAPSHOT</version>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <artifactId>baz</artifactId>
              <groupId>test</groupId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
      

      Such an exclusion is unexpected and seems wrong to me.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            khmarbaise Karl Heinz Marbaise
            dmitrigb Dmitri Gabbasov
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                Slack

                  Issue deployment