<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <packaging>war</packaging>
    <artifactId>brooklyn-web-console</artifactId>
    <name>Brooklyn Web Console</name>
    <description>
        Web App for inspecting Brooklyn operations
    </description>

    <parent>
        <groupId>io.brooklyn</groupId>
        <artifactId>brooklyn-parent</artifactId>
        <version>0.4.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <properties>
        <grails.version>1.3.7</grails.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>brooklyn-core</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>brooklyn-test-support</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.brooklyn</groupId>
            <artifactId>brooklyn-core</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.brooklyn</groupId>
            <artifactId>brooklyn-software-webapp</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-bootstrap</artifactId>
            <version>${grails.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.gpars</groupId>
                    <artifactId>gpars</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.gparallelizer</groupId>
                    <artifactId>GParallelizer</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.gant</groupId>
                    <artifactId>gant_groovy1.7</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.gant</groupId>
                    <artifactId>gant_groovy1.6</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-launcher</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ivy</groupId>
                    <artifactId>ivy</artifactId>
                </exclusion>
                <exclusion>
                    <!-- don't want the version grails pulls in; we supply a better 1.5.11 -->
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-crud</artifactId>
            <version>${grails.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.grails</groupId>
                    <artifactId>grails-docs</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-launcher</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-test</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>radeox</groupId>
                    <artifactId>radeox</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-digester</groupId>
                    <artifactId>commons-digester</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.persistence</groupId>
                    <artifactId>persistence-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-gorm</artifactId>
            <version>${grails.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-launcher</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-digester</groupId>
                    <artifactId>commons-digester</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-commons-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>antlr</groupId>
                    <artifactId>antlr</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-test</artifactId>
            <version>${grails.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.grails</groupId>
                    <artifactId>grails-docs</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-launcher</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>radeox</groupId>
                    <artifactId>radeox</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-digester</groupId>
                    <artifactId>commons-digester</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.persistence</groupId>
                    <artifactId>persistence-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>1.8.0.10</version>
        </dependency>

        <!-- Needed in the case of AOP usage -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.6.8</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.8</version>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.5.3</version>
        </dependency>

        <!-- excluded from war -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <repositories>
        <!-- Required to get hold of javassist:javassist -->
        <repository>
            <id>download.java.net</id>
            <url>http://download.java.net/maven/2/</url>
        </repository>
        <repository>
            <id>grails</id>
            <url>http://repo.grails.org/grails/core</url>
        </repository>
        <repository>
            <id>spring-releases</id>
            <name>Spring Maven RELEASE Repository</name>
            <url>http://maven.springframework.org/release</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>codehaus.snapshots</id>
            <url>http://snapshots.repository.codehaus.org/</url>
        </pluginRepository>
        <!-- suggested for org.xhtmlrenderer:core-renderer:jar:R8 needed by grails-eclipse-plugin to run eclipse:eclpse -->
        <!-- http://grails.1312388.n4.nabble.com/Several-problems-starting-grails-application-with-Maven-according-to-tutorial-td3208760.html -->
        <!-- possibly a bug according to http://jira.grails.org/browse/MAVEN-153 -->
        <!-- according to https://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException it must be a plugin repository -->
        <pluginRepository>
            <id>maven-repository.dev.java.net</id>
            <name>Java Dev Net Repository</name>
            <url>http://download.java.net/maven/2/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <activation>
                <property>
                    <name>withDependencies</name>
                </property>
            </activation>
            <id>war-with-dependencies</id>
            <build>
                <plugins>
                    <!-- with grails, for "skipShade" like behaviour, we set "development" env when invoking grails -->
                    <!-- which is read in BuildConfig to make skinny war or set "production" here to include dependencies -->
                    <plugin>
                        <groupId>org.grails</groupId>
                        <artifactId>grails-maven-plugin</artifactId>
                        <version>${grails.version}</version>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <id>main</id>
                                <goals>
                                    <!-- NOTE plugins are installed and classpath correctly tweaked by maven-compile -->
                                    <goal>maven-compile</goal>
                                    <goal>maven-war</goal>
                                </goals>
                                <configuration>
                                    <env>production</env>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.grails</groupId>
                <artifactId>grails-maven-plugin</artifactId>
                <version>${grails.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>initialize</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>init</goal>
                            <goal>config-directories</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>main</id>
                        <goals>
                            <!-- NOTE plugins are installed and classpath correctly tweaked by maven-compile -->
                            <goal>maven-compile</goal>
                            <goal>maven-war</goal>
                        </goals>
                        <configuration>
                            <env>development</env>
                        </configuration>
                    </execution>
                    <execution>
                        <id>maven-test</id>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <!--
                        <fileset>
                            <directory>.</directory>
                            <includes>
                                <include>stacktrace.log</include>
                                <include>brooklyn.log</include>
                                <include>prodDb.*</include>
                            </includes>
                        </fileset>
                          -->
                        <fileset>
                            <directory>lib</directory>
                            <directory>plugins</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <!-- preventing compiler from doing anything during compile phase -->
                    <excludes>
                        <exclude>**/*.*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>test-jar-creation</id>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
