Index: maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java =================================================================== --- maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java (revision 514056) +++ maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java (working copy) @@ -858,29 +858,7 @@ String dirname = FileUtils.dirname( templateFileName ).replace( '\\', '/' ); - sourceDirectory = sourceDirectory.replace( '\\', '/' ); - if ( sourceDirectory.startsWith( "/" ) ) - { - sourceDirectory = sourceDirectory.substring( 1 ); - } - - if ( !dirname.startsWith( sourceDirectory ) ) - { - throw new ArchetypeTemplateProcessingException( - "Template '" + template + "' not in directory '" + sourceDirectory + "'" ); - } - - String extraPackages = dirname.substring( sourceDirectory.length() ); - if ( extraPackages.startsWith( "/" ) ) - { - extraPackages = extraPackages.substring( 1 ); - } - if ( extraPackages.length() > 0 ) - { - path += "/" + extraPackages; - } - - f = new File( new File( new File( outputDirectory, sourceDirectory ), path ), filename ); + f = new File( new File( new File( outputDirectory, dirname ), path ), filename ); } else {