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

Robert Burrell Donkin updated MSHADE-94:
----------------------------------------

    Attachment: maven-shade-plugin-SimpleRelocator-NullPointerException.patch

This patch includes integration and unit test for the problem described. This 
is  narrow patch addressing only the reported NullPointerException. 

For more sophisticated handling of default packages, IMHO extra functionality 
is needed.

> NullPointerException on empty relocation pattern (default package)
> ------------------------------------------------------------------
>
>                 Key: MSHADE-94
>                 URL: https://jira.codehaus.org/browse/MSHADE-94
>             Project: Maven 2.x Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: J@ck
>         Attachments: 
> maven-shade-plugin-SimpleRelocator-NullPointerException.patch
>
>
> I need a few classes from a 3rd party jar that are declared in the default 
> package. Since usage of the default package should be avoided, I try to 
> relocate the classes to a named package:
> {code:title=pom.xml}
> ...
>   <relocation>
>     <pattern />
>     <shadedPattern>org.example.foo.bar</shadedPattern>
>   </relocation>
> {code}
> The Shade Plugin crashes with a NPE:
> {code:title=Stacktrace}
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating 
> shaded jar: null
>       at 
> org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:503)
>       at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
>       ... 19 more
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.maven.plugins.shade.relocation.SimpleRelocator.<init>(SimpleRelocator.java:52)
>       at 
> org.apache.maven.plugins.shade.mojo.ShadeMojo.getRelocators(ShadeMojo.java:616)
>       at 
> org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:440)
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to