[
https://jira.codehaus.org/browse/ARCHETYPE-459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
James Arlow updated ARCHETYPE-459:
----------------------------------
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.
was:
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 would require a namespace is declared in the document, but not if the
xmlns is excluded, so it could be used during migration, and a new schema can
be created.
> Ability to include empty subdirectories
> ---------------------------------------
>
> Key: ARCHETYPE-459
> URL: https://jira.codehaus.org/browse/ARCHETYPE-459
> Project: Maven Archetype
> Issue Type: Improvement
> Components: Archetypes
> Affects Versions: 2.2
> Environment: Eclipse Kepler SR1; m2e 1.4
> Reporter: James Arlow
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)