<!--
  ~   Copyright 2016 Kamesh Sampath
  ~
  ~   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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>

    <groupId>io.fabric8</groupId>
    <artifactId>vertx-maven-plugin</artifactId>
    <version>0.1.2</version>
    <packaging>maven-plugin</packaging>

    <name>Vert.x Maven Plugin</name>
    <description>A plugin to allow package, start, stop, run of Vert.x applications</description>

    <url>http://github.com/fabric8io/vertx-maven-plugin</url>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/fabric8io/vertx-maven-plugin/issues/</url>
    </issueManagement>

    <developers>
        <developer>
            <id>kameshsampath</id>
            <name>Kamesh Sampath</name>
            <email>kamesh.sampath@hotmail.com</email>
            <roles>
                <role>Java Developer</role>
            </roles>
            <timezone>+5:30</timezone>
        </developer>
    </developers>

    <contributors>
        <contributor>
            <name>Ronald Huß</name>
            <email>protected</email>
            <roles>
                <role>Patch Contributor</role>
            </roles>
        </contributor>
    </contributors>

    <licenses>
        <license>
            <name>Apache License 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/fabric8io/vertx-maven-plugin.git</connection>
        <developerConnection>scm:git:ssh://git@/github.com/fabric8io/vertx-maven-plugin.git</developerConnection>
        <url>https://github.com/fabric8io/vertx-maven-plugin</url>
        <tag>HEAD</tag>
    </scm>


    <!-- FIXME Add  project's scm, developers etc., -->

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-invoker-plugin.version>2.0.0</maven-invoker-plugin.version>
        <maven-plugin-plugin.version>3.4</maven-plugin-plugin.version>
        <maven-plugin-api.version>3.2.5</maven-plugin-api.version>
        <maven-resources-plugin.version>3.0.0</maven-resources-plugin.version>
        <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
        <asciidoctor-maven-plugin.version>1.5.3</asciidoctor-maven-plugin.version>
        <asciidoctorj.version>1.5.4</asciidoctorj.version>
        <asciidoctorj-pdf.version>1.5.0-alpha.11</asciidoctorj-pdf.version>
        <plexus-utils.version>3.0.24</plexus-utils.version>
        <junit.version>4.8.2</junit.version>
        <aether-util.version>1.0.0.v20140518</aether-util.version>
        <maven-aether-provider.version>3.2.5</maven-aether-provider.version>

        <!-- maven-compiler-plugin -->
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>

        <commons-io.version>2.5</commons-io.version>
        <vertx-core.version>3.3.3</vertx-core.version>
        <skipTests>false</skipTests>
        <assertj-core.version>3.4.1</assertj-core.version>
        <commons-lang3.version>3.4</commons-lang3.version>
        <maven-project-info-reports-plugin.version>2.9</maven-project-info-reports-plugin.version>
        <snakeyaml.version>1.17</snakeyaml.version>
        <mojo-executor.version>2.2.0</mojo-executor.version>
        <mockito-all.version>1.10.19</mockito-all.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven-plugin-api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven-plugin-plugin.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>${plexus-utils.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven-plugin-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>

        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
            <version>${vertx-core.version}</version>
        </dependency>

        <!-- Mojo Utils-->
        <dependency>
            <groupId>org.twdata.maven</groupId>
            <artifactId>mojo-executor</artifactId>
            <version>${mojo-executor.version}</version>
        </dependency>

        <!-- Artifact Resolution -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-aether-provider</artifactId>
            <version>${maven-aether-provider.version}</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.aether</groupId>
            <artifactId>aether-util</artifactId>
            <version>${aether-util.version}</version>
        </dependency>

        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${snakeyaml.version}</version>
        </dependency>

        <!-- Packaging and Other Archiving Utilities -->

        <dependency>
            <groupId>org.jboss.shrinkwrap</groupId>
            <artifactId>shrinkwrap-api</artifactId>
            <version>1.2.6</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.shrinkwrap</groupId>
            <artifactId>shrinkwrap-spi</artifactId>
            <version>1.2.6</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.shrinkwrap</groupId>
            <artifactId>shrinkwrap-impl-base</artifactId>
            <version>1.2.6</version>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>org.apache.maven.plugin-testing</groupId>
            <artifactId>maven-plugin-testing-harness</artifactId>
            <version>3.3.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-compat</artifactId>
            <version>3.3.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>${mockito-all.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj-core.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${maven-plugin-plugin.version}</version>
                <configuration>
                    <goalPrefix>vertx</goalPrefix>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
                <executions>
                    <execution>
                        <id>copy-asciidoc</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/META-INF/doc/vmp</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/asciidoc</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>${asciidoctor-maven-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.asciidoctor</groupId>
                            <artifactId>asciidoctorj</artifactId>
                            <version>${asciidoctorj.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <sourceDirectory>src/main/asciidoc</sourceDirectory>
                        <attributes>
                            <icons>font</icons>
                            <pagenums/>
                            <version>${project.version}</version>
                            <toc/>
                            <idprefix/>
                            <idseparator>-</idseparator>
                        </attributes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>run-its</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <version>${maven-invoker-plugin.version}</version>
                        <configuration>
                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                            <cloneClean>true</cloneClean>
                            <settingsFile>src/it/settings.xml</settingsFile>
                            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                            <postBuildHookScript>verify</postBuildHookScript>
                            <addTestClassPath>true</addTestClassPath>
                            <skipInvocation>${skipTests}</skipInvocation>
                            <streamLogs>true</streamLogs>
                            <pomExcludes>
                                <exclude>run-redeploy-blocked-it/pom.xml</exclude>
                                <pomExclude>run-redeploy-blocked-it/pom.xml</pomExclude>
                            </pomExcludes>
                            <invokerPropertiesFile>invoker.properties</invokerPropertiesFile>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-tests</id>
                                <goals>
                                    <goal>install</goal>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>install</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <defaultGoal>clean install</defaultGoal>
            </build>
        </profile>
        <profile>
            <id>site</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-site</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-plugin-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>${maven-project-info-reports-plugin.version}</version>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>index</report>
                                    <report>cim</report>
                                    <report>issue-tracking</report>
                                    <report>license</report>
                                    <report>scm</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>doc-html</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <configuration>
                            <backend>html</backend>
                            <sourceHighlighter>coderay</sourceHighlighter>
                            <attributes>
                                <toc>left</toc>
                            </attributes>
                        </configuration>
                    </plugin>
                </plugins>
                <defaultGoal>generate-resources asciidoctor:process-asciidoc</defaultGoal>
            </build>
        </profile>
        <profile>
            <id>doc-pdf</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <configuration>
                            <backend>pdf</backend>
                            <sourceHighlighter>rouge</sourceHighlighter>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.asciidoctor</groupId>
                                <artifactId>asciidoctorj-pdf</artifactId>
                                <version>${asciidoctorj-pdf.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
                <defaultGoal>generate-resources asciidoctor:process-asciidoc</defaultGoal>
            </build>
        </profile>

        <!-- "release" profiles used for deploying with fabric8 -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
