<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 Lukas Krejci
  ~
  ~ 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>

    <name>Revapi parent</name>
    <description>
        Parent POM for revapi projects. Common deps and site.
    </description>
    <url>${web.url}/modules/${project.artifactId}</url>

    <groupId>org.revapi</groupId>
    <artifactId>revapi-parent</artifactId>
    <packaging>pom</packaging>
    <version>9</version>

    <properties>
        <web.url>https://revapi.org</web.url>
        <web.repo>scm:git:git@github.com:revapi/revapi.github.io.git</web.repo>
        <web.repo.branch>staging</web.repo.branch>
    </properties>

    <build>
        <!-- Sigh - https://jira.codehaus.org/browse/MNG-5588 -->
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.9.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.7.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.16</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.20.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.4</version>
                    <configuration>
                        <skipDeploy>true</skipDeploy>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9</version>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-publish-plugin</artifactId>
                    <version>1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>1.5.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.14</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <tagNameFormat>@{project.artifactId}-@{project.version}</tagNameFormat>
                    <releaseProfiles>release,release-profile</releaseProfiles>
                    <pushChanges>false</pushChanges>
                    <preparationGoals>clean verify</preparationGoals>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>ban-mad-gadget</id>
                        <goals><goal>enforce</goal></goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>commons-collections:commons-collections:[3.0,3.2.1]</exclude>
                                        <exclude>commons-collections:commons-collections:4.0</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports />
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

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

    <organization>
        <name>Lukas Krejci</name>
        <url>http://lukas.krejci.pw</url>
    </organization>

    <developers>
        <developer>
            <name>Lukas Krejci</name>
            <email>revapi@krejci.pw</email>
            <url>http://lukas.krejci.pw</url>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <issueManagement>
        <system>github-issues</system>
        <url>https://github.com/revapi/revapi/issues</url>
    </issueManagement>

    <ciManagement>
        <system>travis</system>
        <url>http://travis-ci.org/revapi/revapi</url>
    </ciManagement>

    <mailingLists>
        <mailingList>
            <name>Revapi</name>
            <subscribe>https://groups.google.com/forum/#!forum/revapi</subscribe>
            <unsubscribe>https://groups.google.com/forum/#!forum/revapi</unsubscribe>
            <post>mailto:revapi@googlegroups.com</post>
            <archive>https://groups.google.com/forum/#!forum/revapi</archive>
        </mailingList>
    </mailingLists>

    <scm>
        <connection>scm:git:git://github.com/revapi/revapi.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/revapi/revapi.git</developerConnection>
        <url>https://github.com/revapi/revapi</url>
      <tag>revapi-parent-9</tag>
  </scm>

    <distributionManagement>
        <site>
            <id>site</id>
            <url>${web.repo}</url>
        </site>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>site-publishing</id>
            <activation>
                <file><exists>${basedir}/src/site/site.xml</exists></file>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <configuration>
                            <inputDirectory>${project.reporting.outputDirectory}</inputDirectory>
                            <outputDirectory>${project.reporting.outputDirectory}/modules/${project.artifactId}</outputDirectory>
                            <relativizeDecorationLinks>false</relativizeDecorationLinks>
                        </configuration>
                        <executions>
                            <execution>
                                <id>stage-for-scm-publish</id>
                                <phase>post-site</phase>
                                <goals>
                                    <goal>stage</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.asciidoctor</groupId>
                                <artifactId>asciidoctor-maven-plugin</artifactId>
                                <version>1.5.2.1</version>
                            </dependency>
                            <dependency>
                                <groupId>pl.matsuo.maven.skins</groupId>
                                <artifactId>msb3-velocity-tools</artifactId>
                                <version>0.1.1</version>
                            </dependency>
                            <!-- MSB3 skin requires Velocity >= 1.7  -->
                            <dependency>
                                <groupId>org.apache.velocity</groupId>
                                <artifactId>velocity</artifactId>
                                <version>1.7</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-scm-publish-plugin</artifactId>
                        <configuration>
                            <scmBranch>${web.repo.branch}</scmBranch>
                            <checkinComment>Committing ${project.name} docs for version ${project.version}.</checkinComment>
                            <ignorePathsToDelete>
                                <ignore>*</ignore>
                            </ignorePathsToDelete>
                        </configuration>
                        <executions>
                            <execution>
                                <id>scm-publish</id>
                                <phase>site-deploy</phase>
                                <goals>
                                    <goal>publish-scm</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
