<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>io.brachu</groupId>
    <artifactId>docker-compose-maven-plugin</artifactId>
    <version>0.9.0</version>
    <packaging>maven-plugin</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Maven plugin that starts and stops a docker-compose cluster.</description>
    <url>https://github.com/br4chu/docker-compose-maven-plugin</url>

    <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>Brachu</name>
        <url>https://github.com/br4chu</url>
    </organization>

    <developers>
        <developer>
            <name>Marcin Jaguś</name>
            <email>marcin.jagus@protonmail.com</email>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/br4chu/docker-compose-maven-plugin</url>
        <connection>scm:git:git@github.com:br4chu/docker-compose-maven-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:br4chu/docker-compose-maven-plugin.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <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>

    <properties>
        <checkstyle.rules.path>checkstyle.xml</checkstyle.rules.path>
        <gpg.keyname>9A481873</gpg.keyname>
        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Dependencies -->
        <johann.version>1.3.0</johann.version>
        <jool.version>0.9.14</jool.version>
        <maven.version>3.6.0</maven.version>

        <!-- Plugins -->
        <checkstyle-plugin.version>3.1.1</checkstyle-plugin.version>
        <compiler-plugin.version>3.8.1</compiler-plugin.version>
        <deploy-plugin.version>2.8.2</deploy-plugin.version>
        <gpg-plugin.version>1.6</gpg-plugin.version>
        <jar-plugin.version>3.2.0</jar-plugin.version>
        <javadoc-plugin.version>3.2.0</javadoc-plugin.version>
        <maven-plugin.version>3.6.0</maven-plugin.version>
        <package-info-plugin.version>2.0.0</package-info-plugin.version>
        <release-plugin.version>2.5.3</release-plugin.version>
        <source-plugin.version>3.2.1</source-plugin.version>
        <spotbugs-plugin.version>4.0.0</spotbugs-plugin.version>
        <surefire-plugin.version>2.22.2</surefire-plugin.version>
    </properties>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <maven.source.skip>true</maven.source.skip>
                <maven.javadoc.skip>true</maven.javadoc.skip>
                <gpg.skip>true</gpg.skip>
            </properties>
        </profile>
        <profile>
            <id>release</id>
        </profile>
    </profiles>

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

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

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

        <dependency>
            <groupId>io.brachu</groupId>
            <artifactId>johann</artifactId>
            <version>${johann.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jooq</groupId>
            <artifactId>jool</artifactId>
            <version>${jool.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>de.shadowhunt.maven.plugins</groupId>
                <artifactId>package-info-maven-plugin</artifactId>
                <version>${package-info-plugin.version}</version>
                <configuration>
                    <outputDirectory>plugin/src/main/java</outputDirectory>
                    <packages>
                        <package>
                            <annotations>
                                <annotation>@javax.annotation.ParametersAreNonnullByDefault</annotation>
                            </annotations>
                            <regex>io\.brachu\..*</regex>
                        </package>
                    </packages>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>package-info</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${spotbugs-plugin.version}</version>
                <configuration>
                    <effort>Max</effort>
                    <maxRank>20</maxRank>
                    <threshold>Medium</threshold>
                </configuration>
                <executions>
                    <execution>
                        <id>analyze-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle-plugin.version}</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>process-sources</phase>
                        <configuration>
                            <configLocation>checkstyle.xml</configLocation>
                            <violationSeverity>warning</violationSeverity>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <configuration>
                    <includes>
                        <include>**/*Tests.java</include>
                        <include>**/*Test.java</include>
                        <include>**/*Spec.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/Abstract*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
                <configuration>
                    <parameters>true</parameters>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${javadoc-plugin.version}</version>
                <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>${gpg-plugin.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <keyname>${gpg.keyname}</keyname>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${deploy-plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${release-plugin.version}</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
