You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tamas Cservenak (Jira)" <ji...@apache.org> on 2022/10/14 10:25:00 UTC

[jira] [Created] (MSHADE-428) Typo causes mysterious NPE in build

Tamas Cservenak created MSHADE-428:
--------------------------------------

             Summary: Typo causes mysterious NPE in build
                 Key: MSHADE-428
                 URL: https://issues.apache.org/jira/browse/MSHADE-428
             Project: Maven Shade Plugin
          Issue Type: Bug
            Reporter: Tamas Cservenak


All versions are affected. 

Has this config for plugin:
{noformat}
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer implementatioh="org.apache.maven.plugins.shade.resource.SisuIndexResourceTransformer" />
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <manifestEntries>
                    <Main-Class>org.apache.maven.index.cli.NexusIndexerCli</Main-Class>
                    <Multi-Release>true</Multi-Release>
                  </manifestEntries>
                </transformer>
              </transformers> {noformat}
And build was failing with 
{noformat}
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.4.0:shade (default) on project indexer-cli: Error creating shaded jar: Problem shading JAR /home/cstamas/Worx/apache-maven/maven-indexer/indexer-cli/target/indexer-cli-7.0.0-SNAPSHOT.jar entry META-INF/sisu/javax.inject.Named: java.lang.NullPointerException -> [Help 1] {noformat}
Cause: there is a typo in config, notive {{implementatioH}} for sisu transformer.

This caused that list of transformes had a null element, and seems there is no validation that transformers list may not have null element. NPE happened when default shared method {{private boolean resourceTransformed(}} stepped onto null element and had {{null.canTransformResource( name )}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)