You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Volkan Yazıcı (JIRA)" <ji...@apache.org> on 2016/04/14 13:02:25 UTC
[jira] [Commented] (MSHADE-36) Dependency reduced pom does not
replace the packaged META-INF/maven version
[ https://issues.apache.org/jira/browse/MSHADE-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15240974#comment-15240974 ]
Volkan Yazıcı commented on MSHADE-36:
-------------------------------------
[~michael-o], I think this is still a valid bug. Here is a test case to reproduce it:
This is how my {{pom.xml}} looks like:
{code:title=pom.xml}
<?xml version="1.0" encoding="UTF-8"?>
<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.vlkan</groupId>
<artifactId>maven-shade-plugin-pom-bug</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.2.1</version>
</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>
<artifactSet>
<includes>
<include>net.java.dev.jna:jna</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{code}
Here, since I am including {{net.java.dev.jna:jna}} within the final artifact, I would expect it to be removed from the {{META-INF/maven/com.vlkan/maven-shade-plugin-pom-bug/pom.xml}} file. But apparently, it is not:
{code}
$ mvn package
$ unzip -p target/maven-shade-plugin-pom-bug-1.0-SNAPSHOT.jar META-INF/maven/com.vlkan/maven-shade-plugin-pom-bug/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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.vlkan</groupId>
<artifactId>maven-shade-plugin-pom-bug</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.2.1</version>
</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>
<artifactSet>
<includes>
<include>net.java.dev.jna:jna</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{code}
Per see, {{net.java.dev.jna:jna}} still appears as a dependency, which actually is not any more. It should have been removed from the dependencies of the final artifact.
[~michael-o], can we re-open this issue? (I suppose I am lacking the sufficient rights to do so.)
> Dependency reduced pom does not replace the packaged META-INF/maven version
> ---------------------------------------------------------------------------
>
> Key: MSHADE-36
> URL: https://issues.apache.org/jira/browse/MSHADE-36
> Project: Maven Shade Plugin
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Mark Hobson
>
> The dependency reduced pom needs to replace the packaged pom at:
> META-INF/maven/<groupId>/<artifactId>/pom.xml
> This will allow tools that use this metadata to read the correct shaded dependencies (e.g. maven-runtime).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)