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

<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->

<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.migration</groupId>
        <artifactId>jboss-server-migration-parent</artifactId>
        <version>1.0.1.Final</version>
    </parent>

    <artifactId>jboss-server-migration-wildfly10.1-feature-pack</artifactId>

    <name>JBoss Server Migration: Wildfly 10.1 Feature Pack</name>
    
    <packaging>pom</packaging>

    <properties>
        <project.version>${project.version}</project.version>
        <license.directory>${project.build.directory}/${project.build.finalName}/content/docs/licenses</license.directory>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions></executions>
            </plugin>
            <plugin>
                <groupId>org.wildfly.build</groupId>
                <artifactId>wildfly-feature-pack-build-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>feature-pack-build</id>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <config-file>feature-pack-build.xml</config-file>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>assemble</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>assembly.xml</descriptor>
                            </descriptors>
                            <finalName>${project.build.finalName}</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                            <workDirectory>${project.build.directory}/assembly/work</workDirectory>
                            <tarLongFileMode>gnu</tarLongFileMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>

		<!-- feature pack dependencies -->

        <dependency>
            <groupId>org.wildfly.core</groupId>
            <artifactId>wildfly-core-feature-pack</artifactId>
            <type>zip</type>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>        

        <!-- module and copy artifact dependencies -->		        

		<dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-core</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>       

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-cli</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>       

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-wildfly8.2</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-wildfly8.2-to-wildfly10.1</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-wildfly9.0</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-wildfly9.0-to-wildfly10.1</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-wildfly10.0</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-wildfly10.0-to-wildfly10.1</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-wildfly10.1</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
        </dependency>    
    </dependencies>
    
    <profiles>
        <profile>
            <id>update-licenses-xml</id>
            <activation>
                <property>
                    <name>!skip-update-licenses-xml</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-licenses-xml</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${license.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${project.basedir}/src/license</directory>
                                            <includes>
                                                <include>*licenses.xml</include>
                                            </includes>
                                            <filtering>false</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.wildfly.maven.plugins</groupId>
                        <artifactId>licenses-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>update-licenses-xml</id>
                                <goals>
                                    <goal>insert-versions</goal>
                                </goals>
                                <phase>prepare-package</phase>
                                <configuration>
                                    <sortByGroupIdAndArtifactId>true</sortByGroupIdAndArtifactId>
                                    <licensesOutputDirectory>${license.directory}</licensesOutputDirectory>
                                    <licensesOutputFile>${license.directory}/migration-feature-pack-licenses.xml</licensesOutputFile>
                                    <excludedScopes>system,provided</excludedScopes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>generate-licenses-html</id>
            <activation>
                <property>
                    <name>!skip-generate-licenses-html</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xml-maven-plugin</artifactId>
                        <version>1.0.1</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>generate-licenses-html</id>
                                <goals>
                                    <goal>transform</goal>
                                </goals>
                                <phase>prepare-package</phase>
                                <configuration>
                                    <transformationSets>
                                        <transformationSet>
                                            <dir>${license.directory}</dir>
                                            <includes>
                                                <include>*licenses.xml</include>
                                            </includes>
                                            <stylesheet>src/license/licenses.xsl</stylesheet>
                                            <outputDir>${license.directory}</outputDir>
                                            <fileMappers>
                                                <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                                    <targetExtension>.html</targetExtension>
                                                </fileMapper>
                                            </fileMappers>
                                            <parameters>
                                                <parameter>
                                                    <name>version</name>
                                                    <value>${project.version}</value>
                                                </parameter>
                                            </parameters>
                                        </transformationSet>
                                    </transformationSets>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>javadocDist</id>
            <properties>
                <javadoc.branding>WildFly public API - ${project.version}</javadoc.branding>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.javadoc.plugin}</version>
                        <executions>
                            <execution>
                                <id>javadocs-dist</id>
                                <goals>
                                    <goal>aggregate-jar</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <debug>true</debug>
                                    <verbose>true</verbose>
                                    <maxmemory>2400m</maxmemory>
                                    <!-- To prevent problems with author names written in non-UTF-8:
                                    -->
                                    <encoding>ISO-8859-1</encoding>

                                    <windowtitle>${javadoc.branding} public API</windowtitle>
                                    <doctitle>${javadoc.branding} public API</doctitle>
                                    <header>${javadoc.branding}</header>
                                    <footer>${javadoc.branding}</footer>

                                    <includeDependencySources>true</includeDependencySources>
                                    <dependencySourceIncludes>
                                        <!-- Filled by a script during creation of Javadoc. -->
                                    </dependencySourceIncludes>

                                    <dependencySourceExcludes>
                                        <!-- Filled by a script during creation of Javadoc. -->
                                    </dependencySourceExcludes>

                                    <groups>
                                        <!-- Filled by a script during creation of Javadoc. -->
                                    </groups>

                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
