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

Michael Osipov commented on MASSEMBLY-937:
------------------------------------------

Can confirm:
{noformat}
osipovmi@deblndw011x:/tmp/bug-maven-assembly
$ zipinfo schedulekeeper/target/schedulekeeper-25.5-zip-with-dependencies.zip
Archive:  schedulekeeper/target/schedulekeeper-25.5-zip-with-dependencies.zip
Zip file size: 12907545 bytes, number of entries: 45
drwxr-xr-x  2.0 unx        0 b- stor 20-Jul-01 21:02 /
-rw-r--r--  2.0 unx     3045 b- defN 20-Jul-07 14:02 /jetty-deps-25.5.pom
-rw-r--r--  2.0 unx   649028 b- defN 20-Jul-07 15:26 
jetty-server-9.4.19.v20190610.jar
-rw-r-----  2.0 unx    95806 b- defN 19-Jun-24 10:17 javax.servlet-api-3.1.0.jar
-rw-r--r--  2.0 unx   155937 b- defN 20-Jul-07 15:26 
jetty-io-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx   207685 b- defN 20-Jul-07 15:26 
jetty-http-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx   526571 b- defN 20-Jul-07 15:26 
jetty-util-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    86798 b- defN 20-Jul-07 15:26 
jetty-annotations-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    63411 b- defN 20-Jul-07 15:26 
jetty-plus-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    46443 b- defN 20-Jul-07 15:26 
jetty-jndi-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx   114762 b- defN 20-Jul-07 15:26 asm-7.1.jar
-rw-r--r--  2.0 unx    70394 b- defN 20-Jul-07 15:26 asm-commons-7.1.jar
-rw-r--r--  2.0 unx    50303 b- defN 20-Jul-07 15:26 asm-tree-7.1.jar
-rw-r--r--  2.0 unx    33379 b- defN 20-Jul-07 15:26 asm-analysis-7.1.jar
-rw-r--r--  2.0 unx   136674 b- defN 20-Jul-07 15:26 
jetty-webapp-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    62225 b- defN 20-Jul-07 15:26 
jetty-xml-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx   121331 b- defN 20-Jul-07 15:26 
jetty-servlet-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx   116949 b- defN 20-Jul-07 15:26 
jetty-security-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    43654 b- defN 20-Jul-07 15:26 
websocket-server-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx   200407 b- defN 20-Jul-07 15:26 
websocket-common-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    52040 b- defN 20-Jul-07 15:26 
websocket-api-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    44937 b- defN 20-Jul-07 15:26 
websocket-client-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx   299585 b- defN 20-Jul-07 15:26 
jetty-client-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    30197 b- defN 20-Jul-07 15:26 
websocket-servlet-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx   101265 b- defN 20-Jul-07 15:26 
jetty-servlets-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    25448 b- defN 20-Jul-07 15:26 
jetty-continuation-9.4.19.v20190610.jar
-rw-r--r--  2.0 unx    26586 b- defN 20-Jul-07 15:26 
javax.annotation-api-1.3.2.jar
-rw-r--r--  2.0 unx  1216381 b- defN 20-Jul-07 15:26 
spring-context-5.2.0.RELEASE.jar
-rw-r--r--  2.0 unx   372562 b- defN 20-Jul-07 15:26 
spring-aop-5.2.0.RELEASE.jar
-rw-r--r--  2.0 unx   684319 b- defN 20-Jul-07 15:26 
spring-beans-5.2.0.RELEASE.jar
-rw-r--r--  2.0 unx  1426560 b- defN 20-Jul-07 15:26 
spring-core-5.2.0.RELEASE.jar
-rw-r--r--  2.0 unx    23768 b- defN 20-Jul-07 15:26 
spring-jcl-5.2.0.RELEASE.jar
-rw-r--r--  2.0 unx   281914 b- defN 20-Jul-07 15:26 
spring-expression-5.2.0.RELEASE.jar
-rw-r--r--  2.0 unx    41472 b- defN 20-Jun-13 15:43 slf4j-api-1.7.30.jar
-rw-r--r--  2.0 unx     9383 b- defN 20-Jul-07 15:26 otj-pausedetector-2.0.3.jar
-rw-r-----  2.0 unx     2497 b- defN 19-Jul-25 10:50 javax.inject-1.jar
-rw-r-----  2.0 unx    16515 b- defN 19-Jun-02 12:40 jcl-over-slf4j-1.7.25.jar
-rw-r--r--  2.0 unx   945690 b- defN 20-Jul-07 15:26 
spring-webmvc-5.2.0.RELEASE.jar
-rw-r--r--  2.0 unx  1408090 b- defN 20-Jul-07 15:26 
spring-web-5.2.0.RELEASE.jar
-rw-r--r--  2.0 unx    23241 b- defN 20-Jul-07 15:26 log4j-slf4j-impl-2.11.1.jar
-rw-r--r--  2.0 unx   264060 b- defN 20-Jul-07 15:26 log4j-api-2.11.1.jar
-rw-r--r--  2.0 unx  1607947 b- defN 20-Jul-07 15:26 log4j-core-2.11.1.jar
-rw-r--r--  2.0 unx   322362 b- defN 19-Dec-09 13:42 cglib-nodep-2.2.jar
-rw-r--r--  2.0 unx  2178083 b- defN 20-Jul-07 15:26 h2-1.4.198.jar
-rw-r--r--  2.0 unx     2692 b- defN 20-Jul-07 15:27 schedulekeeper-25.5.jar
45 files, 14192396 bytes uncompressed, 12901613 bytes compressed:  9.1%
{noformat}

Analyzing...

> Module pom dependency with empty outputDirectory is prefixed with forward 
> slash (/)
> -----------------------------------------------------------------------------------
>
>                 Key: MASSEMBLY-937
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-937
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 3.3.0
>         Environment: MacOS 10.14.6
> openjdk version "11.0.3" 2019-04-16
> OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7)
> OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3+7, mixed mode)
> Maven home: /Users/mpilone/Applications/apache-maven-3.6.3
> Java version: 11.0.3, vendor: AdoptOpenJDK, runtime: 
> /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
>            Reporter: Michael Pilone
>            Priority: Major
>         Attachments: bug-maven-assembly.zip
>
>
> I have a project with a pom dependency:
> {code:java}
> <dependency>
>     <groupId>org.prss.contentdepot</groupId>
>     <artifactId>jetty-deps</artifactId>
>     <version>${project.version}</version>
>     <type>pom</type>
> </dependency> {code}
> I then attempt to assemble a zip with dependencies using the assembly 
> definition:
> {code:java}
> <id>zip-with-dependencies</id>
>   <formats>
>     <format>zip</format>
>   </formats>
>   <includeBaseDirectory>false</includeBaseDirectory>  
> <dependencySets>
>     <dependencySet>
>       <outputDirectory></outputDirectory>
>       <unpack>false</unpack>
>     </dependencySet>
>   </dependencySets> {code}
> This results in the pom being prefixed with a "/" which causes unzip to 
> complain later:
> {code:java}
> DEBUG] Extension realms for project 
> org.prss.contentdepot:jetty-deps:pom:25.5: (none)
> [DEBUG] Looking up lifecycle mappings for packaging pom from 
> ClassRealm[plexus.core, parent: null]
> [DEBUG] Extension realms for project org.prss.contentdepot:shared:pom:25.5: 
> (none)
> [DEBUG] Looking up lifecycle mappings for packaging pom from 
> ClassRealm[plexus.core, parent: null]
> [DEBUG] Extension realms for project org.prss.contentdepot:parent:pom:25.5: 
> (none)
> [DEBUG] Looking up lifecycle mappings for packaging pom from 
> ClassRealm[plexus.core, parent: null]
> [DEBUG] Adding file: 
> /Users/mpilone/.m2/repository/org/prss/contentdepot/jetty-deps/25.5/jetty-deps-25.5.pom
>  to archive location: /jetty-deps-25.5.pom {code}
> Unzip later:
> {code:java}
> unzip ../schedulekeeper-25.5-zip-with-dependencies.zip 
> Archive:  ../schedulekeeper-25.5-zip-with-dependencies.zip
> warning:  stripped absolute path spec from /
> mapname:  conversion of  failed
>   inflating: orm-25.5.jar          
> ...
>   inflating: jetty-client-9.4.19.v20190610.jar  
>   inflating: jetty-io-9.4.19.v20190610.jar  
> warning:  stripped absolute path spec from /jetty-deps-25.5.pom
>   inflating: jetty-deps-25.5.pom      {code}
> The end result is that unzip returns a '2' error code which causes problems 
> with exit status checks in later deployment scripts.
> The root issue appears to be in 
> AddDependencySetsTask.addNonArchiveDependency. Around line 379 (my line 
> numbers might be off a bit from debug output), it checks if outputDirectory 
> ends with forward-slash and if not, it adds one. But in this case 
> outputDirectory is empty so the forward slash should not be added. Here's 
> some debug output from within that method:
> {code:java}
> [DEBUG] MIKE: 
> source=/Users/mpilone/.m2/repository/org/prss/contentdepot/jetty-deps/25.5/jetty-deps-25.5.pom
> [DEBUG] MIKE: destName=jetty-deps-25.5.pom
> [DEBUG] MIKE: target=/jetty-deps-25.5.pom
> [DEBUG] MIKE: outputDirectory=
> {code}
> It also appears that an empty "/" is somehow getting added to the repository 
> as well. I believe it may be related to the same non-artifact dependency:
> {code:java}
> [DEBUG] adding entry jetty-client-9.4.19.v20190610.jar
> [DEBUG] adding entry jetty-io-9.4.19.v20190610.jar
> [DEBUG] adding directory /
> [DEBUG] adding entry /jetty-deps-25.5.pom
> [DEBUG] adding entry jetty-server-9.4.19.v20190610.jar {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to