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

Michael Osipov commented on MASSEMBLY-851:
------------------------------------------

Can reproduce:

{noformat}
[mosipov@bsd10 ~/Projekte/broken-assembly]$ JAVA_VERSION=1.7 mvn -V -q clean 
verify
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 
2015-11-10T17:41:47+01:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.7.0_111, vendor: Oracle Corporation
Java home: /usr/local/openjdk7/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "freebsd", version: "10.3-release-p11", arch: "amd64", family: "unix"

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.github.twz123.brokenassembly.BrokenAssemblyIT
Executing [/usr/local/openjdk7/bin/jar, xf, 
/usr/home/mosipov/Projekte/broken-assembly/target/broken-assembly-0.0.1-SNAPSHOT-broken.jar]
java.io.FileNotFoundException: META-INF/maven (Is a directory)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at sun.tools.jar.Main.copy(Main.java:853)
        at sun.tools.jar.Main.extractFile(Main.java:1043)
        at sun.tools.jar.Main.extract(Main.java:938)
        at sun.tools.jar.Main.run(Main.java:265)
        at sun.tools.jar.Main.main(Main.java:1262)
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.201 sec <<< 
FAILURE! - in com.github.twz123.brokenassembly.BrokenAssemblyIT
unjarBrokenAssembly(com.github.twz123.brokenassembly.BrokenAssemblyIT)  Time 
elapsed: 0.158 sec  <<< FAILURE!
java.lang.AssertionError:
Non-zero exit code from jar executable.
Expected: is <0>
     but: was <1>
        at 
com.github.twz123.brokenassembly.BrokenAssemblyIT.unjarBrokenAssembly(BrokenAssemblyIT.java:33)


Results :

Failed tests:
  BrokenAssemblyIT.unjarBrokenAssembly:33 Non-zero exit code from jar 
executable.
Expected: is <0>
     but: was <1>

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:verify (default) on 
project broken-assembly: There are test failures.
[ERROR]
[ERROR] Please refer to 
/usr/home/mosipov/Projekte/broken-assembly/target/failsafe-reports for the 
individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
{noformat}

{noformat}
[mosipov@bsd10 ~/Projekte/broken-assembly]$ JAVA_VERSION=1.8 mvn -V -q clean 
verify
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 
2015-11-10T17:41:47+01:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: /usr/local/openjdk8/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "freebsd", version: "10.3-release-p11", arch: "amd64", family: "unix"

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.github.twz123.brokenassembly.BrokenAssemblyIT
Executing [/usr/local/openjdk8/bin/jar, xf, 
/usr/home/mosipov/Projekte/broken-assembly/target/broken-assembly-0.0.1-SNAPSHOT-broken.jar]
java.io.FileNotFoundException: META-INF/maven (Is a directory)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at sun.tools.jar.Main.copy(Main.java:909)
        at sun.tools.jar.Main.extractFile(Main.java:1069)
        at sun.tools.jar.Main.extract(Main.java:981)
        at sun.tools.jar.Main.run(Main.java:311)
        at sun.tools.jar.Main.main(Main.java:1288)
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.28 sec <<< 
FAILURE! - in com.github.twz123.brokenassembly.BrokenAssemblyIT
unjarBrokenAssembly(com.github.twz123.brokenassembly.BrokenAssemblyIT)  Time 
elapsed: 0.21 sec  <<< FAILURE!
java.lang.AssertionError:
Non-zero exit code from jar executable.
Expected: is <0>
     but: was <1>
        at 
com.github.twz123.brokenassembly.BrokenAssemblyIT.unjarBrokenAssembly(BrokenAssemblyIT.java:33)


Results :

Failed tests:
  BrokenAssemblyIT.unjarBrokenAssembly:33 Non-zero exit code from jar 
executable.
Expected: is <0>
     but: was <1>

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:verify (default) on 
project broken-assembly: There are test failures.
[ERROR]
[ERROR] Please refer to 
/usr/home/mosipov/Projekte/broken-assembly/target/failsafe-reports for the 
individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
{noformat}

> "Unextractable" JAR files created by assembly:single
> ----------------------------------------------------
>
>                 Key: MASSEMBLY-851
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-851
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>         Environment: Apache Maven 3.3.9 
> (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
> Java version: 1.8.0_121, vendor: Oracle Corporation
> Default locale: de_DE, platform encoding: UTF-8
> OS name: "linux", version: "4.8.0-41-generic", arch: "amd64", family: "unix"
>            Reporter: Tom Wieczorek
>         Attachments: mvn.log
>
>
> Under certain circumstances, {{assembly:single}} generates "unextractable" 
> JAR files, because of some directory entries in the JAR file are not ending 
> with a slash, hence they're treated as file entries.
> If such a JAR file is tried to be extracted via the {{jar}} executable, an 
> Exception is thrown and extraction is aborted:
> {code}
> java.io.FileNotFoundException: META-INF/maven (Is a directory)
>         at java.io.FileOutputStream.open0(Native Method)
>         at java.io.FileOutputStream.open(FileOutputStream.java:270)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
>         at sun.tools.jar.Main.copy(Main.java:909)
>         at sun.tools.jar.Main.extractFile(Main.java:1069)
>         at sun.tools.jar.Main.extract(Main.java:981)
>         at sun.tools.jar.Main.run(Main.java:311)
>         at sun.tools.jar.Main.main(Main.java:1288)
> {code}
> A [sample project|https://github.com/twz123/broken-assembly] is on GitHub.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to