[shrinkwrap-issues] [JBoss JIRA] (SHRINKRES-196) FormatStage should work in a JDK8 friendly way

Karel Piwko (JIRA) issues at jboss.org
Mon Sep 1 09:22:00 EDT 2014


     [ https://issues.jboss.org/browse/SHRINKRES-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karel Piwko updated SHRINKRES-196:
----------------------------------
           Status: Resolved  (was: Pull Request Sent)
           Labels: api-change  (was: )
    Fix Version/s: 2.2.0-alpha-3
       Resolution: Done


Thanks John, I like the proposal. Landed in https://github.com/shrinkwrap/resolver/commit/fb9d64427db2f1cd3221ea1f6ad4764533911ce0 . I've also added documentation into README to make usage of this feature more visible.

> FormatStage should work in a JDK8 friendly way
> ----------------------------------------------
>
>                 Key: SHRINKRES-196
>                 URL: https://issues.jboss.org/browse/SHRINKRES-196
>             Project: ShrinkWrap Resolvers
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: api, impl-maven
>    Affects Versions: 2.2.0-alpha-1, 2.2.0-alpha-2
>            Reporter: John Ament
>              Labels: api-change
>             Fix For: 2.2.0-alpha-3
>
>
> Currently, FormatStage only returns arrays.  In JDK8 if I want to stream the results to merge JARs, I have to do this:
>         JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "se-examples.jar").addPackage(UndertowComponent.class.getPackage())
>                 .addPackage(ExampleConfigSource.class.getPackage()).addPackage(GreeterServlet.class.getPackage())
>                 .addAsManifestResource(new StringAsset(beansXml),"beans.xml");
>         Arrays.stream(Maven.resolver().loadPomFromFile("pom.xml")
>                 .resolve("org.apache.deltaspike.core:deltaspike-core-api","org.apache.deltaspike.core:deltaspike-core-impl")
>                 .withTransitivity().as(JavaArchive.class)).forEach(jar::merge);
> The Arrays.stream here is ugly as sin, requires me to wrap the result.  It would be better if there was an asList(Class<?>) method that did the appropriate type conversion and returned as a list of whatevers.



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the shrinkwrap-issues mailing list