[
https://jira.codehaus.org/browse/MSHADE-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=364479#comment-364479
]
Kristian Rosenvold edited comment on MSHADE-174 at 3/4/15 10:36 AM:
--------------------------------------------------------------------
I did most of the asm5 ports which were necessary to make anything work /at
all/ with java8, and I have been waiting for this issue to pop up :)
The thing is, there are probably some new asm api's that need to be used to
iterate the new jdk8 features, and these have not been implemented anywhere
AFAIK. So if you add a static interface method, and reference a type *only*
from that method, the minimizeJar feature will not "see" that this type is in
use. Same problem might apply to lambdas (maybe)
The solution is to patch stuff so that the new asm methods are called and the
types are added as "used". Patches are welcome and will be reviewed :)
was (Author: krosenvold):
I did most of the asm5 ports which were necessary to make anything work /at
all/ with java8, and I have been waiting for this issue to pop up :)
The thing is, there are probably some new asm api's that need to be used to
iterate the new jdk8 features, and these have not been implemented anywhere
AFAIK. So if you add a static interface method, and reference a type *only*
from that method, the dependency reduction will not "see" that this type is in
use.
The solution is to patch stuff so that the new asm methods are called and the
types are added as "used". Patches are welcome and will be reviewed :)
> Unable to shade Java 8 jarfiles with static interface methods using
> minimizeJar
> -------------------------------------------------------------------------------
>
> Key: MSHADE-174
> URL: https://jira.codehaus.org/browse/MSHADE-174
> Project: Maven Shade Plugin
> Issue Type: Bug
> Affects Versions: 2.2, 2.3
> Environment: WIndows 7 (x64)
> Netbeans 8.0 (also occurs on command line)
> Maven 3.2.1
> (Maven) ASM-5.0.2
> Reporter: Spencer Alderman
> Priority: Critical
> Attachments: effective-pom.txt, out.txt, stacktrace.txt
>
>
> Maven shade does not appear to work with shading in Java 8 jarfiles that
> include static interface methods. A full log of a build with dependency
> resolution is attached (as well as an effective-pom and the stacktrace)
> The error header is:
> {panel}
> Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.3:shade
> (default) on project --: Error creating shaded jar: INVOKESPECIAL/STATIC on
> interfaces require ASM 5 -> [Help 1]
> {panel}
> (Do note, I already am using ASM 5.0.2)
> I've also created a public, reproducible version of this bug:
> https://github.com/1Rogue/Maven-Shade-Bug
> You simply can clone that repo and attempt a "mvn clean install", and it
> should fail accordingly.
> You can also view the stackoverflow question that sent me here:
> http://stackoverflow.com/questions/24415677/unable-to-shade-jar-with-maven-invokespecial-static/24417179#24417179
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)