<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>visallo</artifactId>
        <groupId>org.visallo</groupId>
        <version>2.2.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>visallo-web-group</artifactId>
    <packaging>pom</packaging>
    <name>Visallo: Web</name>

    <modules>
        <module>web-base</module>
        <module>web-base-test</module>
        <module>server</module>
        <module>war</module>
        <module>plugins</module>
        <module>client-api</module>
        <module>client-api-codegen</module>
        <module>web-plugin-base</module>
    </modules>

    <!--
        This execution only works when at this level. It really belongs in 'war/pom.xml', but Maven insists on
        attempting to download that module's war artifact during the clean phase, which makes no sense.
    -->
    <profiles>
        <profile>
            <id>clean-webapp</id>
            <properties>
                <webapp.dir>${basedir}/war/src/main/webapp</webapp.dir>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>${plugin.maven.antrun.version}</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <phase>clean</phase>
                                <configuration>
                                    <target>
                                        <delete dir="${webapp.dir}/jsc"/>
                                        <delete dir="${webapp.dir}/css"/>
                                        <delete dir="${webapp.dir}/libs"/>
                                        <delete dir="${webapp.dir}/node_modules"/>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
