<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.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>19</version>
    </parent>

    <groupId>org.jboss.windup.plugin</groupId>
    <artifactId>windup-maven-plugin</artifactId>
    <version>2.5.0.CR2</version>
    <packaging>maven-plugin</packaging>

    <name>Windup Maven Plugin</name>

    <url>http://windup.jboss.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.source>1.7</maven.compiler.source>

        <version.windup>2.5.0.CR2</version.windup>
        <!-- For now, we need to pass this to the Mojo explicitly (through META-INF/versions.properties),
             but it should be possible to figure that out from the Windup POM. -->
        <version.forge>2.20.1.Final</version.forge>
        <version.furnace>2.22.10.Final</version.furnace>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.windup</groupId>
                <artifactId>windup-bom</artifactId>
                <version>${version.windup}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.windup.rules</groupId>
                <artifactId>windup-rulesets</artifactId>
                <version>${version.windup}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- Maven plugin API -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.3.9</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>3.3.9</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.0.22</version>
        </dependency>
        <!-- Logging and tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>



        <!-- Windup dependencies -->

        <!-- This should be the addon which contains all the core Windup dependencies you need to run Windup. -->
        <dependency>
            <groupId>org.jboss.windup</groupId>
            <artifactId>windup-tooling</artifactId>
            <classifier>forge-addon</classifier>
        </dependency>
        <!-- But it isn't. The needed rest is referenced as deps in bootstrap. -->
        <dependency>
            <groupId>org.jboss.windup</groupId>
            <artifactId>windup-bootstrap</artifactId>
        </dependency>

        <!-- Rules and data -->
        <dependency>
            <groupId>org.jboss.windup.maven</groupId>
            <artifactId>nexus-indexer-data</artifactId>
            <type>zip</type>
        </dependency>

        <dependency>
            <groupId>org.jboss.windup.rules</groupId>
            <artifactId>windup-rulesets</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.windup.rules.apps</groupId>
            <artifactId>windup-rules-java-project</artifactId>
            <classifier>forge-addon</classifier>
        </dependency>

        <dependency>
            <groupId>org.jboss.windup.rules.apps</groupId>
            <artifactId>windup-rules-tattletale</artifactId>
            <classifier>forge-addon</classifier>
            <scope>provided</scope> <!-- Only needs a constant. -->
        </dependency>



        <!-- Furnace -->
        <dependency>
            <groupId>org.jboss.forge.furnace</groupId>
            <artifactId>furnace-se</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.forge.furnace</groupId>
            <artifactId>furnace-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.forge.furnace.container</groupId>
            <!-- Windup switched from :cdi to :simple due to problems with Titan classloading. -->
            <artifactId>simple</artifactId>
            <classifier>forge-addon</classifier>
        </dependency>

        <!-- Forge -->
        <dependency>
            <groupId>org.jboss.forge.addon</groupId>
            <artifactId>core</artifactId>
            <classifier>forge-addon</classifier>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.4</version>
                <configuration>
                    <goalPrefix>windup</goalPrefix>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>run-integration-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <version>1.10</version>
                        <configuration>
                            <debug>true</debug>
                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                            <pomIncludes>
                                <pomInclude>*/pom.xml</pomInclude>
                            </pomIncludes>
                            <postBuildHookScript>verify</postBuildHookScript>
                            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                            <settingsFile>src/it/settings.xml</settingsFile>
                            <goals>
                                <goal>clean</goal>
                                <goal>test-compile</goal>
                            </goals>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>install</goal>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:https://github.com/windup/windup-maven-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:windup/windup-maven-plugin.git</developerConnection>
        <url>http://github.com/windup/windup-maven-plugin</url>
    </scm>

</project>
