2

How can i create an empty directory to be packaged with my project?

Say if i am moving things around, i can do it by

    <fileSet>
        <directory>target</directory>
        <outputDirectory>bin</outputDirectory>
        <includes>
            <include>${project.artifactId}*.jar</include>
        </includes>
        <filtered>true</filtered>
    </fileSet>

But what if all i want is for an empty directory created, with some permissions? How can this be done?

James Raitsev
  • 92,517
  • 154
  • 335
  • 470

1 Answers1

2

In case someone wonders, the following trick will work.

Pick an existing directory cfg and ..

    <fileSet>
        <directory>src/main/resources/cfg</directory>
        <outputDirectory>log</outputDirectory>
        <directoryMode>0755</directoryMode>
        <excludes>
            <exclude>*</exclude>
        </excludes>
        <filtered>false</filtered>
    </fileSet>

    <fileSet>
        <directory>src/main/resources/cfg</directory>
        <outputDirectory>output</outputDirectory>
        <directoryMode>0755</directoryMode>
        <excludes>
            <exclude>*</exclude>
        </excludes>
        <filtered>false</filtered>
    </fileSet>
James Raitsev
  • 92,517
  • 154
  • 335
  • 470
  • 2
    This didn't work for me, but per comment by @Leukipp at [http://stackoverflow.com/questions/7909183/how-do-i-include-an-empty-directory-in-a-maven-assembly] had to use: **/* – mojoken Jun 17 '14 at 21:21