You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (Jira)" <ji...@apache.org> on 2020/02/05 20:06:00 UTC
[jira] [Closed] (MSHADE-324) maven-shade-plugin broken config by
inheritance?
[ https://issues.apache.org/jira/browse/MSHADE-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Scholte closed MSHADE-324.
---------------------------------
Assignee: Robert Scholte
Resolution: Not A Problem
This has nothing to do with the plugin, but how Maven inheritence works and how merges XML. For the details and options, please read https://blog.sonatype.com/2011/01/maven-how-to-merging-plugin-configuration-in-complex-projects/
> maven-shade-plugin broken config by inheritance?
> ------------------------------------------------
>
> Key: MSHADE-324
> URL: https://issues.apache.org/jira/browse/MSHADE-324
> Project: Maven Shade Plugin
> Issue Type: Bug
> Affects Versions: 3.2.1
> Reporter: Miroslav ZaƄko
> Assignee: Robert Scholte
> Priority: Major
>
> it seems like something very bad happens during configuration with inheritance:
> in parent pom pluginManagement:
> {code:xml}
> <configuration>
> <transformers>
> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
> <resource>META-INF/spring.handlers</resource>
> </transformer>
> </transformers>
> </configuration>
> {code}
> in child pom pluginManagement:
> {code:xml}
> <configuration>
> <transformers>
> <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
> </transformers>
> </configuration>
> {code}
> causes broken configuration. In effective child pom is then configuration mixed like:
> {code:xml}
> <configuration>
> <transformers>
> <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer">
> <resource>META-INF/spring.handlers</resource>
> </transformer>
> </transformers>
> </configuration>
> {code}
> and that leads to failing build:
> {code:java}
> Unable to parse configuration of mojo org.apache.maven.plugins:maven-shade-plugin:3.2.1:shade for parameter resource: Cannot find 'resource' in class org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer
> {code}
> It seems like transformer is overwritten by different implementation, but it's configuration is kept from old transformer...
> it is possible to hack it with
> {code:xml}<configuration combine.self="override">{code}
> however it is definitely not correct behaviour
--
This message was sent by Atlassian Jira
(v8.3.4#803005)