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

Endless processing when promoteTransitiveDependencies=true

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.3
    • Fix Version/s: 3.0.0
    • Labels:
      None
    • Environment:
      OS X El Capitan (version 10.11.4)

      Description

      With the following simple pom:

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      	<modelVersion>4.0.0</modelVersion>
      
      	<groupId>com.coolworks</groupId>
      	<artifactId>bug-test</artifactId>
      	<version>1.6.1</version>
      
      	<properties>
      		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      		<maven.compiler.source>1.8</maven.compiler.source>
      		<maven.compiler.target>1.8</maven.compiler.target>
      	</properties>
      
      	<dependencies>
      
      		<dependency>
      			<groupId>org.apache.spark</groupId>
      			<artifactId>spark-core_2.10</artifactId>
      			<version>1.6.1</version>
      			<optional>true</optional>
      		</dependency>
      
      	</dependencies>
      
      	<build>
      		<plugins>
      			<plugin>
      				<groupId>org.apache.maven.plugins</groupId>
      				<artifactId>maven-shade-plugin</artifactId>
      				<version>2.4.3</version>
      				<executions>
      					<execution>
      						<phase>package</phase>
      						<goals>
      							<goal>shade</goal>
      						</goals>
      						<configuration>
      							<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
      							<artifactSet>
      								<includes>
      									<include>org.apache.spark:spark-core_2.10</include>
      								</includes>
      							</artifactSet>
      						</configuration>
      					</execution>
      				</executions>
      			</plugin>
      		</plugins>
      	</build>
      
      </project>
      

      running "mvn clean package" leads the plugin to endlessly print:

      [INFO] Dependency-reduced POM written at: /Users/myuser/Documents/workspace/bug-test/dependency-reduced-pom.xml
      

        Issue Links

          Activity

          Hide
          rfscholte Robert Scholte added a comment -

          Should be fixed as part of MSHADE-225

          Show
          rfscholte Robert Scholte added a comment - Should be fixed as part of MSHADE-225
          Hide
          fabrizio.cucci Fabrizio Cucci added a comment -

          Just to be clear: the issue was not about printing multiple times something but not terminating at all. I'll give it another try with the new snapshot version.

          Show
          fabrizio.cucci Fabrizio Cucci added a comment - Just to be clear: the issue was not about printing multiple times something but not terminating at all. I'll give it another try with the new snapshot version.
          Hide
          hoeferh Henning Hoefer added a comment -

          While the output now (3.0.0) indeed appears only once, the build still isn't terminating.

          Turning off the dependency-reduced off is my current workaround - but this issue is not fixed. Please reopen.

          Show
          hoeferh Henning Hoefer added a comment - While the output now (3.0.0) indeed appears only once, the build still isn't terminating. Turning off the dependency-reduced off is my current workaround - but this issue is not fixed . Please reopen.
          Hide
          baharclerode Bryan Harclerode added a comment - - edited

          I ran into this when I pulled in two artifacts with the same GAV but different classifiers. Specifically, this check does not take into account classifiers, so it repeatedly adds the exclusion to the wrong dependency. If it's trying to exclude something from the second dependency, it will add it to the first dependency and iterate, detect that something still needs to be excluded from the second dependency (since it never got the exclusion) and repeat indefinitely.

          Show
          baharclerode Bryan Harclerode added a comment - - edited I ran into this when I pulled in two artifacts with the same GAV but different classifiers. Specifically, this check does not take into account classifiers, so it repeatedly adds the exclusion to the wrong dependency. If it's trying to exclude something from the second dependency, it will add it to the first dependency and iterate, detect that something still needs to be excluded from the second dependency (since it never got the exclusion) and repeat indefinitely.

            People

            • Assignee:
              rfscholte Robert Scholte
              Reporter:
              fabrizio.cucci Fabrizio Cucci
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Development