[
https://issues.apache.org/jira/browse/MJAR-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16278976#comment-16278976
]
Plamen Totev commented on MJAR-241:
-----------------------------------
I do believe that the root cause is a bug fixed in Apache Commons Compress
1.15. If you override the dependency it should fix the issue:
{code:xml}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.15</version>
</dependency>
</dependencies>
</plugin>
{code}
The next release of Plexus Archiver is going to depend on Apache Commons
Compress 1.15 so once it is released this issue could be fixed by just updating
the Plexus Archiver dependency.
> Jar package does not have a size in ZipEntry
> --------------------------------------------
>
> Key: MJAR-241
> URL: https://issues.apache.org/jira/browse/MJAR-241
> Project: Maven JAR Plugin
> Issue Type: Bug
> Affects Versions: 2.5, 2.6, 3.0.2
> Environment: Windows 7
> Maven 3.3.9
> Reporter: Kaitlyn Lemmons
>
> Since version 2.5, jars output by the maven-jar-plugin do not have a size
> that Java's standard ZipEntry class can read. Version 2.4, however, outputs a
> jar with sizes that works just fine.
> Testing included versions 2.4, 2.5, 2.6, and 3.0.2 - only version 2.4 outputs
> a jar with sizes according to ZipEntry. All configuration was kept constant;
> only the version was altered between each test.
> Sample code is below:
> {code:java}
> ZipInputStream zis = new ZipInputStream(new FileInputStream(jarFile));
> ZipEntry entry = zis.getNextEntry();
> System.out.println(entry.getSize());
> {code}
> Output is -1 for versions 2.5+ and a correct >0 size for version 2.4.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)