Question

I am trying to get maven to include an empty directory which is just used for output files created by the webapp (which is why it is empty).

I have googled and the maven-resources-plugin seemed to be the best option for this, the documentation states that the property includeEmptyDirs is since 2.3 and I am using 2.4, however this seems to do nothing and so far the only way Ive managed to get the directory to create is by putting a text file into it, I dont really want to do this if Maven should be able to do this for me.

Can someone tell me what I am doing wrong? Below is my build section from the pom file:

<build>
   <finalName>MyApp</finalName>
   <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>          
            <configuration>
              <compilerVersion>1.7</compilerVersion>
              <source>1.7</source>
              <target>1.7</target>
            </configuration>
        </plugin>                           
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.4</version>
          <configuration>
            <includeEmptyDirs>true</includeEmptyDirs>
          </configuration>
        </plugin>           
    </plugins>
</build>
Was it helpful?

Solution

Take a look at the maven-war-plugin which has a configuration item includeEmptyDirectories.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top