[shrinkwrap-issues] [JBoss JIRA] (SHRINKWRAP-498) Support JAR file generation with embedded JARs, like the ones generated by spring-boot

Ramon Rivas (JIRA) issues at jboss.org
Thu Dec 17 10:55:00 EST 2015


    [ https://issues.jboss.org/browse/SHRINKWRAP-498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142561#comment-13142561 ] 

Ramon Rivas commented on SHRINKWRAP-498:
----------------------------------------

The issue is triggered by the class @org.arquillian.cube.impl.containerless.ContainerlessDockerDeployableContainer method createDockerFileFromTemplate(..), that exports the JAR using @org.jboss.shrinkwrap.api.exporter.ZipExporter. That ends up using an instance of @org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl that simply exports all entries with default values, which is using ZipEntry.DEFLATED method. I tried to change the code in class @org.jboss.shrinkwrap.impl.base.exporter.zip.ZipOnDemandInputStream to create ZIP entries with ZipEntry.STORED method, but for some reason the Java API doesn't support creating entries with STORED method without knowing the size of the file to store, which is not yet know in that part of the code.

> Support JAR file generation with embedded JARs, like the ones generated by spring-boot
> --------------------------------------------------------------------------------------
>
>                 Key: SHRINKWRAP-498
>                 URL: https://issues.jboss.org/browse/SHRINKWRAP-498
>             Project: ShrinkWrap
>          Issue Type: Feature Request
>    Affects Versions: 1.2.3
>         Environment: ShrinkWrap 1.2.3
> Arquillian Core 1.1.10.Final
> Arquillian Cube 1.0.0.Alpha7
> Spring Boot 1.3.0.RELEASE
>            Reporter: Ramon Rivas
>            Priority: Optional
>
> I'm trying to use Arquillian + Cube Docker + Cube Containerless to generate tests for an application that uses Spring Boot. The Spring Boot plugin ends up generating a JAR file that internally contains other JARs (the application dependencies). Those JARs are stored with no compression (as opposed to regular classes that are stored deflated).
> To simplify my test and make it as compatible as possible to the final artifact, my deployment generation imports the same JAR file that spring boot plugin is generating. But when said JAR is exported internally by Arquillian Cube, all entries (including embedded libraries) are stored in the final JAR file as compressed. As a result, the JAR file cannot be executed using java -jar <my jar file>
> The ideal solution is that the exporter should be aware of this limitation, and embedded JARs inside another JAR shouldn't be compressed.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the shrinkwrap-issues mailing list