<?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>23.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>
        <velocity.version>1.7</velocity.version>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/filtered</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
            <!-- don't generate this, because we need to have some dependencies scoped differently
                 between the features and the onejar maven 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>
            -->

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-features-xml</id>
                        <phase>package</phase>
                        <goals><goal>attach-artifact</goal></goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.outputDirectory}/features.xml</file>
                                    <type>xml</type>
                                    <classifier>features</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- We generate a big onejar.jar file to make Deployment easier -->
            <plugin>
                <groupId>org.dstovall</groupId>
                <artifactId>onejar-maven-plugin</artifactId>
                <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.core</groupId>
            <artifactId>org.opennms.core.xml</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <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.opennms</groupId>
            <artifactId>opennms-config-jaxb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>${velocity.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4jVersion}</version>
        </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>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </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>
