Uploaded image for project: 'ShrinkWrap Resolvers'
  1. ShrinkWrap Resolvers
  2. SHRINKRES-196

FormatStage should work in a JDK8 friendly way

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • 2.2.0-beta-1
    • 2.2.0-alpha-1, 2.2.0-alpha-2
    • api, maven

    Description

      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.

      Attachments

        Activity

          People

            meetoblivion_jira John Ament (Inactive)
            meetoblivion_jira John Ament (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: