[
http://jira.codehaus.org/browse/ARCHETYPE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=215953#action_215953
]
Greg Wittel edited comment on ARCHETYPE-289 at 3/29/10 3:26 PM:
----------------------------------------------------------------
ARCHETYPE-57 was never really resolved. As of alpha-4 and alpha-5 empty
directories are not included in the archetype JAR files. There seem to be two
issues:
1) -- Edit/clarification: Doesn't seem to be necessary.
2) The archetype archiver/JAR goal does not include empty directories unless
explicitly listed in the archetype-metadata.xml. You can't apply inclusion
wildcards, etc. The JAR mojo should include an includeEmptyDirs option.
Additionally, this will require code changes to:
archetype-common/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
(maybe others as well?)
In particular the archiveArchetype and zipper routines to include empty
directories.
e.g. in zipper()
111 {
112 File[] files = currentSourceDirectory.listFiles();
113
114 for ( int i = 0; i < files.length; i++ )
115 {
116 if ( files[i].isDirectory() )
117 {
118 zipper( zos, offset, files[i] );
This area should have a check for if(includeEmptyDirs && files.length == 0) {
... add dir }
was (Author: gwittelpfpoint):
ARCHETYPE-57 was never really resolved. As of alpha-4 and alpha-5 empty
directories are not included in the archetype JAR files. There seem to be two
issues:
1) empty directories are not copied over into target/
This can be resolved by tweaking the resource plugin configuratioN:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>resources</id>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<includeEmptyDirs>true</includeEmptyDirs>
</configuration>
</execution>
</executions>
</plugin>
2) The archetype archiver/JAR goal does not include empty directories. The JAR
mojo should include an includeEmptyDirs option. Additionally, this will
require code changes to:
archetype-common/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
(maybe others as well?)
In particular the archiveArchetype and zipper routines to include empty
directories.
e.g. in zipper()
111 {
112 File[] files = currentSourceDirectory.listFiles();
113
114 for ( int i = 0; i < files.length; i++ )
115 {
116 if ( files[i].isDirectory() )
117 {
118 zipper( zos, offset, files[i] );
This area should have a check for if(includeEmptyDirs && files.length == 0) {
... add dir }
> Support empty directory creation
> --------------------------------
>
> Key: ARCHETYPE-289
> URL: http://jira.codehaus.org/browse/ARCHETYPE-289
> Project: Maven Archetype
> Issue Type: Improvement
> Components: Creator
> Reporter: Greg Wittel
> Fix For: 2.0-alpha-4
>
>
> archetype.xml currently provides no way of creating empty directories.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira