<?xml version="1.0" encoding="UTF-8"?>

<!-- ~ Copyright 2012 Red Hat, Inc. and/or its affiliates. ~ ~ Licensed under the Eclipse Public License version 1.0, available 
    at ~ http://www.eclipse.org/legal/epl-v10.html -->

<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.windup</groupId>
        <artifactId>windup-parent</artifactId>
        <version>2.1.0.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>windup-distribution</artifactId>

    <name>Windup - Distribution Build</name>
    <packaging>pom</packaging>

    <properties>
        <version.nexus.index>1</version.nexus.index>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jboss.forge.furnace</groupId>
                <artifactId>furnace-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>deploy-addons</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>addon-install</goal>
                        </goals>
                        <inherited>false</inherited>
                        <configuration>
                            <addonRepository>${project.build.directory}/addons</addonRepository>
                            <addonIds>
                                <addonId>org.jboss.forge.addon:addon-manager,${version.furnace}</addonId>
                                <addonId>org.jboss.forge.addon:maven,${version.furnace}</addonId>
                                <addonId>org.jboss.forge.addon:projects,${version.furnace}</addonId>
                                <addonId>org.jboss.forge.addon:shell,${version.furnace}</addonId>
                                <addonId>org.jboss.windup:ui,${project.version}</addonId>
                                <addonId>org.jboss.windup.rexster:rexster,${project.version}</addonId>
                                <addonId>org.jboss.windup.rules.apps:rules-java,${project.version}</addonId>
                                <addonId>org.jboss.windup.rules.apps:rules-java-project,${project.version}</addonId>
                                <addonId>org.jboss.windup.rules.apps:rules-java-ee,${project.version}</addonId>
                            </addonIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>distribution-offline</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/assembly-offline.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>

        <!-- Build deps go here -->
        <dependency>
            <groupId>org.jboss.windup</groupId>
            <artifactId>windup-bootstrap</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jboss.windup.maven</groupId>
            <artifactId>nexus-indexer-data</artifactId>
            <version>${version.nexus.index}</version>
            <type>zip</type>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>download-licenses</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <licensesOutputDirectory>
                                        ${project.build.directory}/forge-distribution-${forge.release.version}/docs/licenses
                                    </licensesOutputDirectory>
                                    <licensesOutputFile>
                                        ${project.build.directory}/forge-distribution-${forge.release.version}/docs/licenses/licenses.xml
                                    </licensesOutputFile>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
