<?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">
  <parent>
    <artifactId>opennms</artifactId>
    <groupId>org.opennms</groupId>
    <version>1.9.94-RRP-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>opennms-webapp</artifactId>
  <packaging>war</packaging>
  <name>OpenNMS Web Application</name>
  <properties>
    <moduleName>org.opennms.dashboard.Dashboard</moduleName>
    <moduleHtml>index.html</moduleHtml>
    <web.port>8080</web.port>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>.gwt-cache</directory>
            </fileset>
            <fileset>
              <directory>tomcat</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <archiveClasses>true</archiveClasses>
          <webResources>
            <resource>
              <filtering>true</filtering>
              <directory>${basedir}/src/main/web-filtered</directory>
            </resource>
          </webResources>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.opennms.core.build</groupId>
        <artifactId>castor-maven-plugin</artifactId>
      </plugin>

      <!-- plugin to use to run webapp in an embedded tomcat -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <version>1.0</version>
        <configuration>
          <path>/${project.artifactId}</path>
          <port>${web.port}</port>
        </configuration>
      </plugin>
      <!-- plugin to use to run webapp in an embedded jetty -->
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <configuration>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
              <port>${web.port}</port>
              <maxIdleTime>60000</maxIdleTime>
            </connector>
          </connectors>
          <systemProperties>
            <systemProperty>
              <name>log4j.configuration</name>
              <value>file:${basedir}/runInPlace-log4j.properties</value>
            </systemProperty>
          </systemProperties>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.sun.tools.jxc.maven2</groupId>
        <artifactId>maven-jaxb-schemagen-plugin</artifactId>
        <version>1.2</version>
        <configuration>
          <destdir>${project.build.directory}/xsds</destdir>
          <srcdir>${basedir}/src/main/java</srcdir>
          <verbose>false</verbose>
          <includes>
            <include>org/opennms/web/snmpinfo/*.java</include>
          </includes>
          <schemas>
            <schema>
              <namespace>http://xmlns.opennms.org/xsd/config/snmp-info</namespace>
              <file>snmp-info.xsd</file>
            </schema>
          </schemas>
        </configuration>
        <executions>
          <execution>
            <phase>process-sources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/assembly/meta-inf.xml</descriptor>
            <descriptor>src/assembly/web-inf.xml</descriptor>
            <descriptor>src/assembly/xsds.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Generates the GWT Container and Nature for GWT projects when eclipse:eclipse is run -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <additionalBuildcommands>
            <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
            <buildcommand>com.google.gwt.eclipse.core.gwtProjectValidator</buildcommand>
          </additionalBuildcommands>
          <additionalProjectnatures>
            <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
            <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
          </additionalProjectnatures>
          <classpathContainers>
            <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
            <classpathContainer>com.google.gwt.eclipse.core.GWT_CONTAINER</classpathContainer>
          </classpathContainers>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
            <execution>
                <id>attach-artifacts</id>
                <phase>package</phase>
                <goals>
                    <goal>attach-artifact</goal>
                </goals>
                <configuration>
                    <artifacts>
                        <artifact>
                            <file>target/opennms-webapp-1.9.94-RRP-SNAPSHOT/WEB-INF/lib/opennms-webapp-1.9.94-RRP-SNAPSHOT.jar</file>
                            <type>jar</type>
                        </artifact>
                    </artifacts>
                </configuration>
            </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>jspc</id>
      <activation><activeByDefault>true</activeByDefault></activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-jspc-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>jspc</id>
                <goals>
                  <goal>jspc</goal>
                </goals>
                <configuration>
                  <webXmlFragment>${basedir}/target/web.xml.jspc-insert</webXmlFragment>
                  <generatedClasses>${basedir}/target/jsp-classes</generatedClasses>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <!-- indirect dependencies that belong in $OPENNMS_HOME/lib -->
    <!-- these should all be <scope>provided</scope> and also included in opennms-base-assembly -->
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-web-dependencies</artifactId>
      <type>pom</type>
      <scope>provided</scope>
      <!-- 
        We have to exclude this Java compiler from the classpath because it
        conflicts with one bundled inside gwt-dev that is used when GWT compiles
        code into Javascript.

        http://code.google.com/p/google-web-toolkit/issues/detail?id=5290
      -->
      <exclusions>
        <exclusion>
          <groupId>org.eclipse.jdt.core.compiler</groupId>
          <artifactId>ecj</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.opennms.dependencies</groupId>
      <artifactId>rancid-dependencies</artifactId>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features.reporting</groupId>
      <artifactId>org.opennms.features.reporting.core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features.reporting</groupId>
      <artifactId>org.opennms.features.reporting.api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features.reporting</groupId>
      <artifactId>org.opennms.features.reporting.availability</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features.reporting</groupId>
      <artifactId>org.opennms.features.reporting.model</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features.reporting</groupId>
      <artifactId>org.opennms.features.reporting.dao</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features.reporting</groupId>
      <artifactId>org.opennms.features.reporting.repository</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features</groupId>
      <artifactId>org.opennms.features.request-tracker</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features</groupId>
      <artifactId>org.opennms.features.system-report</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-dom</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-svg-dom</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-transcoder</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-xml</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-util</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.opennms.core</groupId>
        <artifactId>org.opennms.core.soa</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- direct dependencies that should be in WEB-INF/lib -->
    <dependency>
      <groupId>org.opennms.dependencies</groupId>
      <artifactId>gwt-dependencies</artifactId>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.extremecomponents</groupId>
      <artifactId>extremecomponents</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.collections</groupId>
      <artifactId>google-collections</artifactId>
    </dependency>
    <dependency>
      <groupId>net.sf.opencsv</groupId>
      <artifactId>opencsv</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms.features</groupId>
      <artifactId>org.opennms.features.instrumentationLogReader</artifactId>
    </dependency>   
    <dependency>
      <groupId>net.sf.json-lib</groupId>
      <artifactId>json-lib</artifactId>
      <classifier>jdk15</classifier>
    </dependency>
    <dependency>
      <groupId>ognl</groupId>
      <artifactId>ognl</artifactId>
      <version>2.6.9</version>
    </dependency>
    <dependency>
      <groupId>org.tuckey</groupId>
      <artifactId>urlrewrite</artifactId>
    </dependency>
    <dependency>
      <groupId>poi</groupId>
      <artifactId>poi</artifactId>
    </dependency>
    <!-- for RSS feeds -->
    <dependency>
      <groupId>rome</groupId>
      <artifactId>rome</artifactId>
    </dependency>
    <dependency>
      <groupId>struts</groupId>
      <artifactId>struts</artifactId>
    </dependency>
    <!-- GWT components -->
    <dependency>
        <groupId>org.opennms.features</groupId>
        <artifactId>org.opennms.features.opennms-gwt-theme</artifactId>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>org.opennms.features</groupId>
        <artifactId>org.opennms.features.node-page-list</artifactId>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>org.opennms.features</groupId>
        <artifactId>org.opennms.features.gwt-ksc-combobox</artifactId>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>org.opennms.features</groupId>
        <artifactId>org.opennms.features.gwt-suggestion-combobox</artifactId>
        <type>jar</type>
        <version>${project.version}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.opennms.features</groupId>
        <artifactId>org.opennms.features.gwt-graph-resources-list</artifactId>
        <type>jar</type>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>org.opennms.features</groupId>
        <artifactId>org.opennms.features.gwt-snmpselect-list</artifactId>
        <type>jar</type>
        <version>${project.version}</version>
    </dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-dao</artifactId>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-services</artifactId>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-provision-persistence</artifactId>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-test</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms.core.test-api</groupId>
      <artifactId>org.opennms.core.test-api.http</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms.tests</groupId>
      <artifactId>org.opennms.tests.mock-elements</artifactId>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-core</artifactId>
      <version>1.0.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-server-jndi</artifactId>
      <version>1.0.2</version>
      <scope>test</scope>
    </dependency>

    
  </dependencies>
</project>
