<archetype>
    <id>maven-archetype-mule-project</id>
    <variables>
        <variable>
            <name>description</name>
            <description>Provide a description of what the project does:</description>
            <!-- Note that you always need a <defValue> element for -Dinteractive=false to work -->
            <defvalue></defvalue>
        </variable>
        <variable>
            <name>muleVersion</name>
            <description>Which version of Mule is this module targeted at?</description>
            <defvalue>${muleVersion}</defvalue>
        </variable>
        <variable>
            <name>package</name>
            <description>What is the base Java package path for this module? (i.e. org/mule/modules or
                org/mule/examples):
            </description>
            <defvalue>org/mule/applications</defvalue>
        </variable>
        <variable>
            <name>forgeProject</name>
            <description>Will This project be hosted on MuleForge? [y] or [n]</description>
            <defvalue>y</defvalue>
        </variable>
        <variable>
            <name>projectType</name>
            <description>What type of project is this?
                - [s]tand alone project
                - [m]ule module to be hosted on the MuleForge on in the Mule distribution
            </description>
            <defvalue>s</defvalue>
        </variable>
        <variable>
            <name>hasCustomSchema</name>
            <description>Will This project have a custom schema for configuring the module in Xml?</description>
            <defvalue>n</defvalue>
        </variable>
        <variable>
            <name>hasBootstrap</name>
            <description>Will This project need to make objects available in the Registry as soon as it's loaded?
            </description>
            <defvalue>n</defvalue>
        </variable>
    </variables>

    <templates>
        <!-- the template pom should be run fisrt since it sets up some other variables -->
        <template>
            <file>pom.vm</file>
            <output>pom.xml</output>
        </template>
        <template>
            <file>LICENSE.vm</file>
            <output>LICENSE.txt</output>
        </template>
        <template>
            <file>assembly.xml.vm</file>
            <output>assembly.xml</output>
        </template>

        <template>
            <file>src/main/java/org/mule/modules/Messages.vm</file>
            <output>
                src/main/java/${package}/${ModuleNameLower}/i18n/${ModuleName}Messages.java
            </output>
        </template>
        <template>
            <file>src/main/resources/META-INF/services/org/mule/i18n/messages.vm</file>
            <output>src/main/resources/META-INF/services/org/mule/i18n/${ModuleNameLower}-messages.properties
            </output>
        </template>
        <template>
            <file>src/main/resources/META-INF/services/org/mule/config/registry-bootstrap.properties</file>
            <output>src/main/resources/META-INF/services/org/mule/config/registry-bootstrap.properties</output>
            <dependsOnVar>hasBootstrap=y</dependsOnVar>
        </template>
        <template>
            <file>src/main/resources/META-INF/spring.handlers.vm</file>
            <output>src/main/resources/META-INF/spring.handlers</output>
            <dependsOnVar>hasCustomSchema=y</dependsOnVar>
        </template>
        <template>
            <file>src/main/resources/META-INF/spring.schemas.vm</file>
            <output>src/main/resources/META-INF/spring.schemas</output>
            <dependsOnVar>hasCustomSchema=y</dependsOnVar>
        </template>
        <template>
            <file>src/main/resources/META-INF/schema.vm</file>
            <output>src/main/resources/META-INF/mule-${ModuleNameLower}.xsd</output>
            <dependsOnVar>hasCustomSchema=y</dependsOnVar>
        </template>
        <template>
            <file>src/main/java/org/mule/modules/config/NamespaceHandler.vm</file>
            <output>
                src/main/java/${package}/${ModuleNameLower}/config/${ModuleName}NamespaceHandler.java
            </output>
            <dependsOnVar>hasCustomSchema=y</dependsOnVar>
        </template>

        <!-- Test Cases -->
        <template>
            <file>src/test/java/org/mule/modules/FunctionalTestCase.vm</file>
            <output>
                src/test/java/${package}/${ModuleNameLower}/${ModuleName}TestCase.java
            </output>
        </template>
        <template>
            <file>src/test/resources/functional-test-config.xml.vm</file>
            <output>
                src/test/resources/${ModuleNameLower}-functional-test-config.xml
            </output>
        </template>
        <template>
            <file>src/test/java/org/mule/modules/NamespaceHandlerTestCase.vm</file>
            <output>
                src/test/java/${package}/${ModuleNameLower}/${ModuleName}NamespaceHandlerTestCase.java
            </output>
            <dependsOnVar>hasCustomSchema=y</dependsOnVar>
        </template>
        <template>
            <file>src/test/resources/namespace-config.xml.vm</file>
            <output>
                src/test/resources/${ModuleNameLower}-namespace-config.xml
            </output>
            <dependsOnVar>hasCustomSchema=y</dependsOnVar>
        </template>
    </templates>
</archetype>

