<?xml version="1.0"?>
<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>
    <groupId>org.opennms</groupId>
    <artifactId>org.opennms.features</artifactId>
    <version>1.9.94-RRP-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.opennms.features</groupId>
  <artifactId>org.opennms.features.remote-poller</artifactId>
  <packaging>jar</packaging>
  <name>OpenNMS Remote Poller</name>
  <url>http://maven.apache.org</url>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-groovy-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/groovy</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <additionalBuildcommands>
            <buildcommand>org.codehaus.groovy.eclipse.groovyBuilder</buildcommand>
          </additionalBuildcommands>
          <additionalProjectnatures>
            <projectnature>org.codehaus.groovy.eclipse.groovyNature</projectnature>
          </additionalProjectnatures>
          <additionalConfig>
            <file>
              <name>.settings/org.codehaus.groovy.eclipse.preferences.prefs</name>
              <content>
<!-- note the newlines in this are important please don't format -->
<![CDATA[
#Added by maven-eclipse-plugin
eclipse.preferences.version=1
groovy.compiler.output.path=target/classes
]]>
              </content>
            </file>
          </additionalConfig>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.groovy.maven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-key</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>
                def keystore = new File(project.properties['webstart.keystore'])
                if (!keystore.exists()) {
                  keystore.parentFile.mkdirs();
                  println "keystore is missing, generating for alias '${project.properties['webstart.keyalias']}'"
                  def args = [
                    keystore: project.properties['webstart.keystore'],
                    alias: project.properties['webstart.keyalias'],
                    storepass: project.properties['webstart.storepass'],
                    dname: "cn=${project.properties['webstart.dnameCn']}"
                  ]
                  if (project.properties['webstart.keypass']) {
                    args.put('keypass', project.properties['webstart.keypass'])
                  }
                  def ant = new AntBuilder();
                  ant.genkey(args)
                }
              </source>
            </configuration>
          </execution>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-model</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-services</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-wmi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms.dependencies</groupId>
      <artifactId>spring-dependencies</artifactId>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.opennms.dependencies</groupId>
      <artifactId>spring-security-dependencies</artifactId>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.opennms.dependencies</groupId>
      <artifactId>spring-web-dependencies</artifactId>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-util</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms.core</groupId>
      <artifactId>org.opennms.core.lib</artifactId>
    </dependency>
    <!-- pull in all ICMP APIs in case the user wants to use them -->
    <dependency>
      <groupId>org.opennms.core</groupId>
      <artifactId>org.opennms.core.icmp-jna</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-icmp-jna</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-icmp-jni</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-icmp-jni6</artifactId>
    </dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>org.opennms.core.test-api</groupId>
      <artifactId>org.opennms.core.test-api.http</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-test</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms.tests</groupId>
      <artifactId>org.opennms.tests.mock-elements</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opennms</groupId>
      <artifactId>opennms-dao</artifactId>
      <scope>test</scope>
    </dependency>
    <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-rrd-jrobin</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.opennms.features</groupId>
      <artifactId>org.opennms.features.springframework-security</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
