[ 
https://issues.apache.org/jira/browse/MASSEMBLY-788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14978106#comment-14978106
 ] 

Matias Cuturi commented on MASSEMBLY-788:
-----------------------------------------

Sorry, I found out that it was a bug in the vertx version and not in the Maven 
Assembly Plugin.

See runZip - fix bugs in unpacking zips in
http://vertx.io/blog/vert-x-2-1-6-released/

Commit
https://github.com/eclipse/vert.x/commit/a5c0a61855440865979b92753ea2139290819ee3

The ticket can be closed.
Thanks & Regards

> Entry names in ZIP file are not correctly parsed when unzipping it
> ------------------------------------------------------------------
>
>                 Key: MASSEMBLY-788
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-788
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.6
>         Environment: Windows 7 Professional, JDK 1.8.0_25, maven 3.2.5, 
> vertx-platform-2.1.5
>            Reporter: Matias Cuturi
>
> Hello Team,
> I had a problem when upgrading the Maven Assembly Plugin from 2.5.5 to 2.6. 
> The problem happens when calling the the function _unzipModuleData_ of the 
> class _DefaultPlatformManager.java_ (see vertx-platform-2.1.5) with a zip 
> file created by the Maven Assembly Plugin 2.6. The error message "Failed to 
> create directory" is thrown. This issue does not happen with v2.5.5.
> Example:
> Assuming that following module was compressed with v2.6:
> module/foo/bar/baz.java --> module.zip
> when unziping the file:
> {code}
> //Pseudo code
> String directory = "C:\unzip_directory\";
> InputStream is = new BufferedInputStream(new FileInputStream("C:\module.zip");
> ZipInputStream zis = new ZipInputStream(new BufferedInputStream(is));
> while ((entry = zis.getNextEntry()) != null) {
> //Create the directory structure from the zip file
> ...
> ...
> String entryName = entry.getName();
> if (!new File(directory, entryName).mkdir()) {
>       throw new PlatformManagerException("Failed to create directory");
> }
> }
> {code}
> the value of _entryName_ in the first while-iteration is "module/foo/bar/" 
> instead of being "module/" in the first iteration,  "foo/" in the second and 
> "bar/" in the third one. This causes an error when trying to create the new 
> file.
> This issue is probably only happening in Windows machines.
> Regards,
> Matias



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to