    @Test
    public void buildAllExampleArchetypes() throws Exception {

        File srcDir = new File(basedir, "src/test/examples").getCanonicalFile();

        try {
            List<String> dirs = new ArrayList<String>();
            archetypeBuilder.generateArchetypes("java", srcDir, new File(basedir, "target/test-archetypes"), true, dirs);
        } finally {
            LOG.info("Completed the generation. Closing!");
        }

        Collection<File> files = Files.recursiveList(new File("target/test-archetypes/java-hello-world-archetype"), new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return true;
            }
        });

        String[] resources = new String[] {
            "",
            "/pom.xml",
            "/.gitignore",
            "/src",
            "/src/main",
            "/src/main/resources",
            "/src/main/resources/archetype-resources",
            "/src/main/resources/archetype-resources/ReadMe.txt",
            "/src/main/resources/archetype-resources/pom.xml",
            "/src/main/resources/archetype-resources/src",
            "/src/main/resources/archetype-resources/src/test",
            "/src/main/resources/archetype-resources/src/test/java",
            "/src/main/resources/archetype-resources/src/test/java/HelloTest.java",
            "/src/main/resources/archetype-resources/src/main",
            "/src/main/resources/archetype-resources/src/main/resources",
            "/src/main/resources/archetype-resources/src/main/resources/application.properties",
            "/src/main/resources/archetype-resources/src/main/java",
            "/src/main/resources/archetype-resources/src/main/java/impl",
            "/src/main/resources/archetype-resources/src/main/java/impl/DefaultHello.java",
            "/src/main/resources/archetype-resources/src/main/java/HelloInterface.java",
            "/src/main/resources-filtered",
            "/src/main/resources-filtered/META-INF",
            "/src/main/resources-filtered/META-INF/maven",
            "/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml",
        };
        for (String r : resources) {
            File file = new File("target/test-archetypes/java-hello-world-archetype" + r);
            assertTrue(r + " should exists", files.remove(file));
        }
        assertTrue("Failed to create correct Archetype project", files.isEmpty());
    }