[ https://issues.apache.org/jira/browse/MASSEMBLY-852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17201153#comment-17201153
]
Michael Boyles edited comment on MASSEMBLY-852 at 9/23/20, 10:54 PM:
---------------------------------------------------------------------
Looked into it a bit more. The problem is that ant pattern * does not match root directory,
and nor is it supposed to. But obviously the archiver still needs to create the intermediate
directories. It has 2 types of directory mode, and we're only setting 1 of them. We need to
set the other.
I think you should be able to work around this by using the following pattern. It seems undocumented
but [if you dig down into the code enough|https://github.com/codehaus-plexus/plexus-utils/blob/master/src/main/java/org/codehaus/plexus/util/MatchPattern.java#L45],
it's supported
{code:java}
%regex[.*] {code}
Unlike the ant pattern, this will match everything.
We can fix it on the plugin side, will raise a PR.
was (Author: michaelboyles):
Looked into it a bit more. The problem is that ant pattern * does not match root directory,
and nor is it supposed to.
I think you should be able to work around this by using the following pattern. It seems undocumented
but [if you dig down into the code enough|https://github.com/codehaus-plexus/plexus-utils/blob/master/src/main/java/org/codehaus/plexus/util/MatchPattern.java#L45],
it's supported
{code:java}
%regex[.*] {code}
Unlike the ant pattern, this will match everything.
We can fix it on the plugin side, will raise a PR.
> <directoryMode> permissions are lost if <include> is present
> ------------------------------------------------------------
>
> Key: MASSEMBLY-852
> URL: https://issues.apache.org/jira/browse/MASSEMBLY-852
> Project: Maven Assembly Plugin
> Issue Type: Bug
> Components: component descriptor, permissions
> Affects Versions: 3.0.0
> Environment: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m;
support was removed in 8.0
> Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T00:58:10+03:00)
> Java version: 1.8.0_51, vendor: Oracle Corporation
> Java home: /usr/java/jdk1.8.0_51/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "2.6.32-573.8.1.el6.x86_64", arch: "amd64", family: "unix"
> Reporter: Anton
> Priority: Minor
> Attachments: test.rar
>
>
> Used next descriptor:
> {code:xml}
> <assembly>
> <id>test</id>
> <formats>
> <format>zip</format>
> </formats>
> <includeBaseDirectory>false</includeBaseDirectory>
> <fileSets>
> <fileSet>
> <directory>bin</directory>
> <outputDirectory>bin-include</outputDirectory>
> <includes>
> <include>*</include>
> </includes>
> <directoryMode>700</directoryMode>
> <fileMode>700</fileMode>
> </fileSet>
> <fileSet>
> <directory>bin</directory>
> <outputDirectory>bin-no-include</outputDirectory>
> <directoryMode>700</directoryMode>
> <fileMode>700</fileMode>
> </fileSet>
> </fileSets>
> </assembly>
> {code}
> For both *<filesSets>* same *directoryMode* is set, but for case where *<include>*
pattern is present directory permissions are broken.
> Listing:
> {noformat}
> $ zipinfo target/testpom-1.0.0.zip
> Archive: target/testpom-1.0.0.zip
> Zip file size: 502 bytes, number of entries: 4
> drwxr-xr-x 2.0 unx 0 b- stor 17-Apr-19 17:48 bin-include/
> drwx------ 2.0 unx 0 b- stor 17-Apr-19 15:48 bin-no-include/
> -rwx------ 2.0 unx 0 bl defN 17-Apr-19 15:48 bin-include/testfile
> -rwx------ 2.0 unx 0 bl defN 17-Apr-19 15:48 bin-no-include/testfile
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
|