You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Joerg Schaible (Jira)" <ji...@apache.org> on 2021/06/17 08:41:00 UTC

[jira] [Commented] (MASSEMBLY-752) [PATCH] Option to ignore empty directories in fileSet directory

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

Joerg Schaible commented on MASSEMBLY-752:
------------------------------------------

Is there any reason, why this patch has been ignored simply and the issue closed with "Won't Do"? If you exclude files by pattern from a fileset, your result might contain unwanted empty directories and there's no possibility to get rid of it.

> [PATCH] Option to ignore empty directories in fileSet directory
> ---------------------------------------------------------------
>
>                 Key: MASSEMBLY-752
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-752
>             Project: Maven Assembly Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.5.3
>            Reporter: Guillaume Boué
>            Priority: Major
>         Attachments: MASSEMBLY-ignoreEmptyDirectories.patch
>
>
> When the directory attribute of fileSets contains empty directories, it would be nice to have an option to ignore them.
> ======= Actual behaviour =======
> Considering the structure :
> {noformat}
> src/
>        +-- folder1/file.txt
>        +-- folder2/
> {noformat}
> with the following fileSet in {{assembly.xml}} :
> {code:xml}
> <fileSet>
>     <directory>src</directory>
>     <outputDirectory>/</outputDirectory>
> </fileSet>
> {code}
> the assembly-plugin produces, as of today :
> {noformat}
> /folder1/file.txt
> /folder2
> {noformat}
> Note that the empty directory folder2 is present in the assembly.
> ======= Proposed enhancement =======
> With this enhancement, it would be possible to have the following in {{assembly.xml}} :
> {code:xml}
> <fileSet>
>     <directory>src</directory>
>     <outputDirectory>/</outputDirectory>
>     <includeEmptyDirectories>false</includeEmptyDirectories>
> </fileSet>
> {code}
> and the resulting assembly would be :
> {noformat}
> /folder1/file.txt
> {noformat}
> Note that folder2 would not be present inside the assembly because it is empty.
> Attached is a patch adding the attribute "includeEmptyDirectories" to the fileSet element in assembly.xml file. For backward compatibility, the default value of this attribute is true.



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