<?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">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>org.opennms.features</artifactId>
        <groupId>org.opennms</groupId>
        <version>19.0.0-SNAPSHOT</version>
    </parent>
    <groupId>org.opennms.features</groupId>
    <artifactId>jmxconfiggenerator</artifactId>
    <packaging>bundle</packaging>
    <name>OpenNMS :: Features :: JMX Config Generator</name>
    <url>http://www.opennms.org</url>

    <properties>
        <jmxremote.optional.version>1.0_01-ea</jmxremote.optional.version>
        <velocity.version>1.7</velocity.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.opennms.maven.plugins</groupId>
                <artifactId>features-maven-plugin</artifactId>
                <configuration>
                    <features>
                        <feature>guava</feature>
                        <feature>commons-io</feature>
                    </features>
                    <bundles>
                        <bundle>mvn:org.opennms.features/jmxconfiggenerator/${project.version}</bundle>
                        <bundle>wrap:mvn:args4j/args4j/${args4jVersion}</bundle>
                        <bundle>wrap:mvn:org.jvnet.opendmk/jmxremote_optional/${jmxremote.optional.version}</bundle>
                        <bundle>mvn:org.apache.velocity/velocity/${velocity.version}</bundle>
                    </bundles>
                </configuration>
            </plugin>
            <!-- We need this to generate the JmxConfig.xml data model for the config generator tool.
            The one defined by opennms-config cannot be used, because it describes the whole config file.
            We only need a sub set of the overall schema, which makes it easier to program.
            However the subset defined in "jmx-datacollection.config.xsd" must be compatible with the one
            defined in opennms-config. -->
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.opennms.dependencies</groupId>
                        <artifactId>jaxb-dependencies</artifactId>
                        <type>pom</type>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- We generate a big onejar.jar file to make Deployment easier -->
            <plugin>
                <groupId>org.dstovall</groupId>
                <artifactId>onejar-maven-plugin</artifactId>
                <version>1.4.4</version>
                <configuration>
                    <filename>${project.artifactId}-${project.version}-onejar.jar</filename>
                    <mainClass>org.opennms.features.jmxconfiggenerator.Starter</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.opennms.features</groupId>
            <artifactId>org.opennms.features.name-cutter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>${velocity.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4jVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>args4j</groupId>
            <artifactId>args4j</artifactId>
            <version>${args4jVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.jvnet.opendmk</groupId>
            <artifactId>jmxremote_optional</artifactId>
            <version>${jmxremote.optional.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <!-- Provided by a Karaf feature -->
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <!-- Provided by a Karaf feature -->
            <scope>provided</scope>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
    </dependencies>
    <pluginRepositories>
        <pluginRepository>
            <id>onejar-maven-plugin.googlecode.com</id>
            <url>http://maven.opennms.org/content/repositories/onejar-maven-plugin.googlecode.com/</url>
        </pluginRepository>
    </pluginRepositories>
</project>
