默认情况下,在构建过程中,maven会删除空目录。 您是否知道是否可以在pom中指定一个参数来指示maven在生成的target / test-classes文件夹中包括空目录?


According to this ticket MRESOURCES-36, there should be a <includeEmptyDirs> element, but only for Maven Resources Plugin 2.3.



Until this issue is fixed, here is a workaround I've been using successfully.
Add this plugin element into project/build/plugins in your pom.xml, and change the dir in the mkdir task.

You can have multiple <mkdir> elements for multiple directories. The mkdir task does nothing if the directory has already been copied by the resources plugin.

          <mkdir dir="${basedir}/target/classes/empty" />

This originally came from the openejb-standalone pom.xml in the openejb project.