maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miroslav Zaťko (JIRA) <j...@apache.org>
Subject [jira] [Updated] (MSHADE-324) maven-shade-plugin broken config by inheritance?
Date Sun, 04 Aug 2019 20:54:00 GMT

     [ https://issues.apache.org/jira/browse/MSHADE-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Miroslav Zaťko updated MSHADE-324:
----------------------------------
    Description: 
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

  was:
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...


> 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
>            Priority: Critical
>
> 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
(v7.6.14#76016)

Mime
View raw message