added a comment - - edited
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 }
ARCHETYPE-57was 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 }