You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl Heinz Marbaise (JIRA)" <ji...@apache.org> on 2015/05/29 23:10:21 UTC

[jira] [Resolved] (MSHADE-183) Getting "Error creating shaded jar: java.util.jar.Attributes cannot be cast to java.lang.String" error when using ManifestResourceTransformer with Maven 3.2.5

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

Karl Heinz Marbaise resolved MSHADE-183.
----------------------------------------
    Resolution: Fixed
      Assignee: Karl Heinz Marbaise

Fixed in [r1682553|http://svn.apache.org/r1682553].

> Getting "Error creating shaded jar: java.util.jar.Attributes cannot be cast to java.lang.String" error when using ManifestResourceTransformer with Maven 3.2.5
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MSHADE-183
>                 URL: https://issues.apache.org/jira/browse/MSHADE-183
>             Project: Maven Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Chris Heisterkamp
>            Assignee: Karl Heinz Marbaise
>             Fix For: 2.4
>
>         Attachments: manifest_resource_transformer_error.diff
>
>
> If you are using the {{ManifestResourceTransformer}} with empty values in the configuration you will get a {{"Error creating shaded jar: java.util.jar.Attributes cannot be cast to java.lang.String"}} error with Maven 3.2.5.
> Here as an example config that causes the problem
> {code:xml}       
> <configuration>
>   <transformers>
>     <transformer
>         implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
>       <manifestEntries>
>         <Main-Class>com.mycompany.app.App</Main-Class>
>         <Implementation-Build></Implementation-Build>
>       </manifestEntries>
>     </transformer>
>   </transformers>
> </configuration>
> {code}
> I'm not sure what changed in populating the manifestEntries map but it looks like the {{manifestEntries.entrySet()}} in {{ManifestResourceTransformer}} is now getting back {{Attributes}} objects for the {{null}} values instead of {{null}}.  When the transformer calls {{getValue()}} on the {{Attributes}} object you get the error.
> The fix was to make manifestEntries a {{Map<String, Object>}} instead of {{Map<String, Attributes>}}. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)