I had the same problem. I tested all of the above solutions, and none of them worked for me. The best solution I had in mind, and it worked for me, was to pre-create these parent folders as empty folders before writing them.
So, to relate to the original problem, you should use:
<fileSet> <directory>./</directory> <outputDirectory>/resources</outputDirectory> <excludes> <exclude>*/**</exclude> </excludes> <directoryMode>0700</directoryMode> </fileSet>
This should be placed before in the actual copy in the resource subfolder in your example.
./- this is just an existing folder. It can be any other folder if it exists. Please note that we exclude any file from the file. Thus, the result will be an empty folder with the appropriate set of permissions.
On the side of the note, whoever uses tar to package files, without this set, the tar file will not have the permissions set for this parent folder. Thus, the extraction will lead to the creation of a new folder, but with the permissions of the extracting user + his umask.
0700 was used, of course, just for example.
source share