<?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>
    <parent>
        <relativePath>../topology-map/poms/compiled/</relativePath>
        <groupId>org.opennms.features.topology.build</groupId>
        <artifactId>compiled-bundle-settings</artifactId>
        <version>14.0.2</version>
    </parent>
    <groupId>org.opennms.features</groupId>
    <artifactId>vaadin-dashboard</artifactId>
    <packaging>bundle</packaging>
    <name>OpenNMS Features Dashboard</name>
    <description>
        OpenNMS Vaadin Dashboard
    </description>
    <properties>
        <bundle.symbolicName>org.opennms.features.vaadin-dashboard</bundle.symbolicName>
        <bundle.namespace>org.opennms.features.vaadin.dashboard</bundle.namespace>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <guava.version>${guavaVersion}</guava.version>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>org/opennms/features/vaadin/dashboard/internal/gwt/public/**</include>
                </includes>
            </resource>
        </resources>
        <plugins>

            <plugin>
                <!--
                 | the following instructions build a simple set of public/private classes into an OSGi bundle
                -->
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Export-Package>${bundle.namespace}.*;version="${project.version}"</Export-Package>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.plugin.version}</version>
                <configuration>
                    <extraJvmArgs>-Xmx1g -Xss1024k</extraJvmArgs>
                    <webappDirectory>${basedir}/target/gwt/VAADIN/widgetsets</webappDirectory>
                    <hostedWebapp>${basedir}/target/gwt/VAADIN/widgetsets</hostedWebapp>
                    <noServer>true</noServer>
                    <draftCompile>false</draftCompile>
                    <compileReport>false</compileReport>
                    <style>OBF</style>
                    <strict>true</strict>
                    <runTarget>http://localhost:8980/opennms/dashboard</runTarget>
                    <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
                </configuration>
                <executions>
                    <execution>
                        <configuration>
                            <!-- if you don't specify any modules, the plugin will find them -->
                            <!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module>
                                </modules> -->
                        </configuration>
                        <goals>
                            <goal>resources</goal>
                            <goal>update-widgetset</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-dev</artifactId>
                        <version>${gwtVersion}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-user</artifactId>
                        <version>${gwtVersion}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.opennms.maven.plugins</groupId>
                <artifactId>features-maven-plugin</artifactId>
                <configuration>
                    <bundles>
                        <bundle>mvn:org.opennms.features/vaadin-dashboard/${project.version}</bundle>
                        <bundle>wrap:mvn:org.vaadin.addons/dragdroplayouts/1.1.1</bundle>
                    </bundles>
                    <features>
                        <feature>opennms-core</feature>
                        <feature>vaadin</feature>
                    </features>
                </configuration>
            </plugin>
        </plugins>

    </build>

    <repositories>
        <repository>
            <snapshots><enabled>true</enabled></snapshots>
            <releases><enabled>false</enabled></releases>
            <id>opennms-snapshots</id>
            <name>OpenNMS Snapshot Maven Repository</name>
            <url>http://maven.opennms.org/content/groups/opennms.org-snapshot</url>
        </repository>
        <repository>
            <id>vaadin-snapshots</id>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled></snapshots>
            <url>http://maven.opennms.org/content/groups/vaadin-snapshot/</url>
        </repository>
        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>codehaus-snapshots</id>
            <snapshots><enabled>true</enabled></snapshots>
            <releases><enabled>false</enabled></releases>
            <url>http://maven.opennms.org/content/groups/codehaus.org-snapshot/</url>
        </pluginRepository>
        <pluginRepository>
            <id>vaadin-snapshots</id>
            <snapshots><enabled>true</enabled></snapshots>
            <releases><enabled>false</enabled></releases>
            <url>http://maven.opennms.org/content/groups/vaadin-snapshot/</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>dragdroplayouts</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
<!--
        <dependency>
            <groupId>org.vaadin.addon</groupId>
            <artifactId>PortalLayout</artifactId>
            <version>2.0.alpha5</version>
        </dependency>
-->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- OSGi Dependencies -->

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.opennms.osgi</groupId>
            <artifactId>opennms-osgi-core</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Vaadin Dependencies -->

        <dependency>
            <groupId>org.opennms.osgi.features.topology</groupId>
            <artifactId>vaadin</artifactId>
            <type>pom</type>
        </dependency>

        <!-- Required by pax/vaadin -->
        <dependency>
            <groupId>org.opennms.dependencies</groupId>
            <artifactId>servlet-dependencies</artifactId>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.opennms.features.themes</groupId>
            <artifactId>dashboard-theme</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.opennms</groupId>
            <artifactId>opennms-web-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.opennms.core</groupId>
            <artifactId>org.opennms.core.criteria</artifactId>
            <scope>provided</scope>
        </dependency>

    </dependencies>

</project>
