You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andrei Solntsev (Jira)" <ji...@apache.org> on 2022/05/10 07:22:00 UTC
[jira] [Commented] (MSHADE-419) Shade plugin causes pom to be created without compile dependencies
[ https://issues.apache.org/jira/browse/MSHADE-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17534191#comment-17534191 ]
Andrei Solntsev commented on MSHADE-419:
----------------------------------------
How is it possible that this mega-critical bug is still not fixed? ... :(
> Shade plugin causes pom to be created without compile dependencies
> ------------------------------------------------------------------
>
> Key: MSHADE-419
> URL: https://issues.apache.org/jira/browse/MSHADE-419
> Project: Maven Shade Plugin
> Issue Type: Bug
> Affects Versions: 3.3.0
> Reporter: BM
> Priority: Critical
> Labels: shade
>
> A project using shade-plugin 3.2.4 deploys with a pom containing all the dependencies as defined.
> A project using shade-plugin 3.3.0 deploys with a pom containing only the 'test' and 'provided' dependencies. This causes transitive dependency issues for downstream projects.
>
> {code:java}
> <?xml version="1.0"?>
> <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>test</groupId>
> <artifactId>shade-apr-2022</artifactId>
> <packaging>jar</packaging>
> <version>1.0.0-SNAPSHOT</version>
> <properties>
> <jackson-version>2.9.6</jackson-version>
> </properties>
> <dependencies>
> <dependency>
> <groupId>com.fasterxml.jackson.core</groupId>
> <artifactId>jackson-core</artifactId>
> <version>${jackson-version}</version>
> </dependency>
> <dependency>
> <groupId>com.fasterxml.jackson.core</groupId>
> <artifactId>jackson-databind</artifactId>
> <version>${jackson-version}</version>
> </dependency>
> <dependency>
> <groupId>com.fasterxml.jackson.core</groupId>
> <artifactId>jackson-annotations</artifactId>
> <version>${jackson-version}</version>
> </dependency>
> <dependency>
> <groupId>com.thoughtworks.xstream</groupId>
> <artifactId>xstream</artifactId>
> <version>1.4.10</version>
> </dependency>
> <!-- Test dependencies -->
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.11</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>3.8.0</version>
> <configuration>
> <release>11</release>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-shade-plugin</artifactId>
> <version>3.3.0</version>
> <executions>
> <execution>
> <phase>package</phase>
> <goals>
> <goal>shade</goal>
> </goals>
> <configuration>
> <shadedArtifactAttached>true</shadedArtifactAttached>
> <transformers>
> <transformer
> implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
> <resource>META-INF/spring.handlers</resource>
> </transformer>
> <transformer
> implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
> <resource>META-INF/spring.factories</resource>
> </transformer>
> <transformer
> implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
> <resource>META-INF/spring.schemas</resource>
> </transformer>
> <transformer
> implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
> </transformers>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> </project> {code}
> Dependencies in deployed pom with shade-plugin 3.2.4:
> {code:java}
> <dependencies>
> <dependency>
> <groupId>com.fasterxml.jackson.core</groupId>
> <artifactId>jackson-core</artifactId>
> <version>${jackson-version}</version>
> </dependency>
> <dependency>
> <groupId>com.fasterxml.jackson.core</groupId>
> <artifactId>jackson-databind</artifactId>
> <version>${jackson-version}</version>
> </dependency>
> <dependency>
> <groupId>com.fasterxml.jackson.core</groupId>
> <artifactId>jackson-annotations</artifactId>
> <version>${jackson-version}</version>
> </dependency>
> <dependency>
> <groupId>com.thoughtworks.xstream</groupId>
> <artifactId>xstream</artifactId>
> <version>1.4.10</version>
> </dependency>
> <!-- Test dependencies -->
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.11</version>
> <scope>test</scope>
> </dependency>
> </dependencies> {code}
> Dependencies in deployed pom with shade-plugin 3.3.0:
> {code:java}
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.11</version>
> <scope>test</scope>
> <exclusions>
> <exclusion>
> <artifactId>hamcrest-core</artifactId>
> <groupId>org.hamcrest</groupId>
> </exclusion>
> </exclusions>
> </dependency>
> </dependencies> {code}
> Note also an exclusion on hamcrest-core. I don't know where that is coming from.
> It looks to be related to the {{dependency-reduced-pom.xml}} but the behaviour has changed in this plugin version.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)