<?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>
        <groupId>org.mule.tools.devkit</groupId>
        <artifactId>mule-devkit-tools</artifactId>
        <version>3.3.1</version>
    </parent>

    <name>Mule DevKit Nexus Plugin</name>
    <description>The DevKit Nexus Plugin augments Nexus indexing capabilities with extra information directly
        related to Mule modules, adding schema information, as well as cataloging them along with DevKit plugins into
        special catalog files.
    </description>

    <artifactId>mule-devkit-nexus-plugin</artifactId>
    <packaging>nexus-plugin</packaging>

    <properties>
        <app-lifecycle.version>1.4</app-lifecycle.version>
        <nexus.version>2.0.3</nexus.version>
    </properties>


    <dependencies>
        <dependency>
            <groupId>org.sonatype.nexus</groupId>
            <artifactId>nexus-plugin-api</artifactId>
            <version>${nexus.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.sonatype.nexus.plugins</groupId>
            <artifactId>nexus-indexer-lucene-plugin</artifactId>
            <version>${nexus.version}</version>
            <scope>provided</scope>
            <type>nexus-plugin</type>
        </dependency>
        <dependency>
            <groupId>org.sonatype.nexus.plugins</groupId>
            <artifactId>nexus-indexer-lucene-plugin</artifactId>
            <version>${nexus.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.sonatype.nexus</groupId>
            <artifactId>nexus-rest-api</artifactId>
            <version>${nexus.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-component-annotations</artifactId>
            <version>1.5.5</version>
        </dependency>
        <dependency>
            <groupId>org.mule.tools.devkit</groupId>
            <artifactId>mule-devkit-schema-model</artifactId>
            <version>3.3.1</version>
        </dependency>

        <!-- Basic testing -->
        <dependency>
            <groupId>org.sonatype.nexus</groupId>
            <artifactId>nexus-plugin-test-api</artifactId>
            <version>${nexus.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.5</version>
            <scope>test</scope>
        </dependency>

        <!-- #ITSet BEGINS -->
        <!-- Nexus IT setup (dependencies below are needed if you have extensive ITs and you want to use Nexus Environment) -->
        <!-- There are plugins connected to this dependency, see below! -->
        <dependency>
            <groupId>org.sonatype.nexus</groupId>
            <artifactId>nexus-test-harness-launcher</artifactId>
            <scope>test</scope>
            <version>${nexus.version}</version>
        </dependency>
        <!-- #ITSet ENDS -->
    </dependencies>

    <!-- #ITSet BEGINS -->
    <!-- Nexus IT setup (dependencies below are needed if you have extensive ITs and you want to use Nexus Environment) -->
    <!-- There are plugins and dependencies connected to this import, see below and above! -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.sonatype.nexus</groupId>
                <artifactId>nexus-webapp-dependencies</artifactId>
                <version>${nexus.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <!-- #ITSet ENDS -->

    <build>
        <plugins>
            <!-- Needed for custom packaging -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>app-lifecycle-maven-plugin</artifactId>
                <version>${app-lifecycle.version}</version>
                <extensions>true</extensions>
                <dependencies>
                    <dependency>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>app-lifecycle-nexus</artifactId>
                        <version>${app-lifecycle.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Needed for the custom indexer -->
            <plugin>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-component-metadata</artifactId>
                <version>1.5.5</version>
                <executions>
                    <execution>
                        <id>process-classes</id>
                        <goals>
                            <goal>generate-metadata</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>process-test-classes</id>
                        <goals>
                            <goal>generate-test-metadata</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Have to set source level to at least Java5, we use annotations (Nexus requries 1.6) -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <!-- #ITSet BEGINS -->
            <!-- Nexus IT setup (dependencies below are needed if you have extensive ITs and you want to use Nexus Environment) -->
            <!-- There are dependencies connected to this set of plugin, see above! -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-test-environment-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>setup-nexus-plugin-environment</goal>
                        </goals>
                        <configuration>
                            <nexusBundleArtifact>
                                <groupId>org.sonatype.nexus</groupId>
                                <artifactId>nexus-oss-webapp</artifactId>
                                <version>${nexus.version}</version>
                                <type>zip</type>
                                <classifier>bundle</classifier>
                            </nexusBundleArtifact>
                            <nexusBundleName>nexus-oss-webapp-${nexus.version}</nexusBundleName>
                            <nexusVersion>${nexus.version}</nexusVersion>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <nexusVersion>${nexus.version}</nexusVersion>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.shared</groupId>
                        <artifactId>maven-filtering</artifactId>
                        <version>1.0-beta-4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-utils</artifactId>
                        <version>1.5.9</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.8.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- #ITSet ENDS -->
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>clojars.org</id>
            <url>http://clojars.org/repo</url>
        </repository>
        <repository>
            <id>nuxeo</id>
            <url>http://maven.nuxeo.org/nexus/content/groups/public</url>
        </repository>
    </repositories>

</project>