<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2017 Red Hat, Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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.eap.xp</groupId>
        <artifactId>jboss-server-migration-parent</artifactId>
        <version>6.0.0.GA-redhat-00019</version>
        <relativePath>../../../../pom.xml</relativePath>
    </parent>

    <artifactId>jboss-server-migration-docs-userguide-tool-standalone</artifactId>

    <name>JBoss Server Migration: Docs User-Guide Tool Standalone</name>

    <dependencies>

        <!-- includes -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-docs-userguide-tool-includes</artifactId>
        </dependency>
        <!--
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-docs-userguide-migration-includes</artifactId>
        </dependency>
        -->

        <!-- migrations -->

        <!-- EAP 8.1 -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-eap8.0-to-eap8.1-userguide</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jboss-server-migration-eap8.1-to-eap8.1-userguide</artifactId>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <configuration>
                        <attributes>
                            <tool-distributionType>standalone</tool-distributionType>
                        </attributes>
                    </configuration>
                </plugin>
                <plugin>
	                <groupId>org.apache.maven.plugins</groupId>
    	            <artifactId>maven-dependency-plugin</artifactId>
    	            <configuration>
                        <excludes>META-INF/**</excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/asciidoc</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/asciidoc</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-includes</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/asciidoc</outputDirectory>
                            <includeArtifactIds>jboss-server-migration-docs-userguide-tool-includes</includeArtifactIds>
                        </configuration>
                    </execution>

                    <!-- EAP 8.1 -->
                    <execution>
                        <id>EAP8.0toEAP8.1</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeArtifactIds>jboss-server-migration-eap8.0-to-eap8.1-userguide</includeArtifactIds>
                            <outputDirectory>${project.build.outputDirectory}/migrations/eap8.0-to-eap8.1</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>EAP8.1toEAP8.1</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeArtifactIds>jboss-server-migration-eap8.1-to-eap8.1-userguide</includeArtifactIds>
                            <outputDirectory>${project.build.outputDirectory}/migrations/eap8.1-to-eap8.1</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>tool</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <sourceDocumentName>master.adoc</sourceDocumentName>
                            <outputFile>${project.build.outputDirectory}/index.html</outputFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
