<assembly>
    <id>war-dist</id>

    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>true</includeBaseDirectory>

    <fileSets>
        <fileSet>
            <directory>${project.build.directory}/unpacked/examples</directory>
            <outputDirectory>examples</outputDirectory>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}/unpacked/docs</directory>
            <outputDirectory>docs</outputDirectory>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}/unpacked/wildfly-${wildfly.version}</directory>
            <outputDirectory>keycloak</outputDirectory>
            <excludes>
                <exclude>**/*.sh</exclude>
                <exclude>welcome-content/*</exclude>
                <exclude>**/modules/system/layers/base/org/picketlink/**</exclude>
                <exclude>**/modules/system/layers/base/org/jboss/as/cli/**</exclude>
                <exclude>**/modules/system/layers/base/org/jboss/aesh/**</exclude>
            </excludes>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}/unpacked/wildfly-${wildfly.version}</directory>
            <outputDirectory>keycloak</outputDirectory>
            <includes>
                <include>**/*.sh</include>
            </includes>
            <fileMode>0755</fileMode>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}/unpacked/modules</directory>
            <outputDirectory>keycloak/modules/system/layers/base</outputDirectory>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}/unpacked/deployments/auth-server.war/WEB-INF/classes/META-INF
            </directory>
            <outputDirectory>keycloak/standalone/configuration</outputDirectory>
            <includes>
                <include>keycloak-server.json</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}/unpacked/themes</directory>
            <outputDirectory>keycloak/standalone/configuration/themes</outputDirectory>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}/unpacked/adapter</directory>
            <outputDirectory>keycloak</outputDirectory>
        </fileSet>
        <fileSet>
            <directory>src/main/welcome-content</directory>
            <outputDirectory>keycloak/welcome-content</outputDirectory>
            <includes>
                <include>*.*</include>
            </includes>
        </fileSet>
    </fileSets>

    <files>
        <file>
            <source>src/main/themes/README.txt</source>
            <outputDirectory>keycloak/standalone/configuration/themes</outputDirectory>
        </file>
        <file>
            <source>src/main/providers/README.txt</source>
            <outputDirectory>keycloak/standalone/configuration/providers</outputDirectory>
        </file>
    </files>
</assembly>
