Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Auto Closed
-
2.2
-
None
-
None
-
Eclipse Kepler SR1; m2e 1.4
Description
Currently the artifact-metadata.xml will allow only allow you to include empty directories if each is explicitly specified in a unique fileset element. It doesn't allow you to specify a folder that holds empty sub-directories with <include>*/*</include>.
Even if these empty directories are included in the /archetype-resources/ folder of the archetype.jar they will not be created from by the archetype:generate goal when the archetype is applied.
Explicitly specifying every empty directory does not scale well, in terms of simplicity and clarity of configuration. Another user pointed out that the current behavior prevents filtered results from working properly with certain SCM situations, as well.
Since the original pom.xml is not packaged inside the archetype.jar, archetype:generate cannot be signaled to change this behavior using the plugin version or configuration pom elements, as with other optional maven features such as the resource plugin equivalent.
Additionally, the desired behavior might differ per fileset pattern, and should not default to on, since it might corrupt the output of archetypes already deployed.
I think the best system would be to add a behavior qualifier as an attribute on the fileset pattern elements in archetype-metadata.xml:
<!-- to include empty dirs -->
<include empty-dirs="true">*/*</include>
<!-- to prevent exclusion of empty dirs -->
<exclude empty-dirs="false">*/*</exclude>
This creates schema errors, but the schema's presence is not necessary for the archetype plugin to function. A new schema can be created to accommodate.