<?xml version="1.0" encoding="UTF-8"?>
<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>

    <groupId>io.payworks.labs.tcpmocker</groupId>
    <artifactId>tcp-mocker-parent</artifactId>
    <version>1.0.144.RELEASE</version>
    <packaging>pom</packaging>
    <name>payworks/labs/tcp-mocker/parent</name>
    <description>Library for mocking any TCP based protocol</description>
    <url>https://github.com/payworks/tcp-mocker</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>andreysaksonov</id>
            <name>Andrey Saksonov</name>
            <email>andrey.saksonov@payworks.com</email>
        </developer>
        <developer>
            <id>dmalch</id>
            <name>Dmitry Malchikov</name>
            <email>dmitry.malchikov@payworks.com</email>
        </developer>
        <developer>
            <id>enrique-alonso-martin-pw</id>
            <name>Enrique Alonso-Martin</name>
            <email>enrique.alonso-martin@payworks.com</email>
        </developer>
        <developer>
            <id>aComanche</id>
            <name>Miguel Hernández</name>
            <email>miguel.hernandez@payworks.com</email>
        </developer>
        <developer>
            <id>pawelreal</id>
            <name>Pawel Wozniak</name>
            <email>pawel.wozniak@payworks.com</email>
        </developer>
        <developer>
            <id>gitmik</id>
            <name>Mikolaj Sosna</name>
            <email>mikolaj.sosna@payworks.com</email>
        </developer>
        <developer>
            <id>quarksplitter</id>
            <name>Matej Risek</name>
            <email>matej.risek@payworks.com</email>
        </developer>
    </developers>
    <modules>
        <module>tcp-mocker-app</module>
        <module>tcp-mocker-app-test</module>
        <module>tcp-mocker-core</module>
        <module>tcp-mocker-netty</module>
        <module>tcp-mocker-support</module>
        <module>tcp-mocker-model</module>
        <module>tcp-mocker-web</module>
        <module>tcp-mocker-interface</module>
        <module>tcp-mocker-service</module>
    </modules>
    <scm>
        <connection>scm:git:git://github.com/payworks/tcp-mocker.git</connection>
        <developerConnection>scm:git:git@github.com:payworks/tcp-mocker.git</developerConnection>
        <tag>HEAD</tag>
        <url>https://github.com/payworks/tcp-mocker</url>
    </scm>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <!-- Maven -->
        <maven.deploy.skip>true</maven.deploy.skip>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.release>11</maven.compiler.release>

        <!-- Project -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Dependencies -->
        <spring-boot.version>2.1.5.RELEASE</spring-boot.version>
        <springfox.version>2.9.2</springfox.version>
        <testng.version>6.14.3</testng.version>
        <hamcrest.version>2.1</hamcrest.version>
        <hamcrest-optional.version>1.1.4</hamcrest-optional.version>
        <guava.version>27.1-jre</guava.version>
        <apache-commons.version>3.9</apache-commons.version>
        <commons-io.version>2.6</commons-io.version>
        <testcontainers.version>1.11.3</testcontainers.version>

        <!-- Plugins -->
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>2.22.1</maven-failsafe-plugin.version>
        <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
        <guava-beta-checker.version>1.0</guava-beta-checker.version>
        <google-errorprone.version>2.3.3</google-errorprone.version>
        <spotify-dockerfile-maven-plugin.version>1.4.8</spotify-dockerfile-maven-plugin.version>
        <sortpom-maven-plugin.version>2.10.0</sortpom-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-app</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-app</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
            </dependency>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-interface</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-model</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-netty</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-service</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-support</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.payworks.labs.tcpmocker</groupId>
                <artifactId>tcp-mocker-web</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger2</artifactId>
                <version>${springfox.version}</version>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger-ui</artifactId>
                <version>${springfox.version}</version>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-bean-validators</artifactId>
                <version>${springfox.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>com.spotify</groupId>
                <artifactId>hamcrest-optional</artifactId>
                <version>${hamcrest-optional.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${apache-commons.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
                <version>${spring-boot.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <version>${spring-boot.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>${testcontainers.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.spotify</groupId>
            <artifactId>hamcrest-optional</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>maven-central</id>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>maven-central</id>
            <url>http://repo1.maven.org/maven2</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <finalName>${project.artifactId}</finalName>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <filtering>false</filtering>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <release>${maven.compiler.release}</release>
                        <compilerArgs>
                            <arg>-XDcompilePolicy=simple</arg>
                            <arg>-Xplugin:ErrorProne -Xep:BetaApi:ERROR</arg>
                        </compilerArgs>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>com.google.errorprone</groupId>
                                <artifactId>error_prone_core</artifactId>
                                <version>${google-errorprone.version}</version>
                            </path>
                            <path>
                                <groupId>com.google.guava</groupId>
                                <artifactId>guava-beta-checker</artifactId>
                                <version>${guava-beta-checker.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.spotify</groupId>
                    <artifactId>dockerfile-maven-plugin</artifactId>
                    <version>${spotify-dockerfile-maven-plugin.version}</version>
                    <configuration>
                        <repository>tcpmocker/${project.artifactId}</repository>
                        <skipPush>${maven.deploy.skip}</skipPush>
                        <buildArgs>
                            <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                        </buildArgs>
                        <googleContainerRegistryEnabled>false</googleContainerRegistryEnabled>
                    </configuration>
                    <executions>
                        <execution>
                            <id>tag-latest</id>
                            <goals>
                                <goal>build</goal>
                                <goal>tag</goal>
                                <goal>push</goal>
                            </goals>
                            <phase>deploy</phase>
                            <configuration>
                                <tag>latest</tag>
                            </configuration>
                        </execution>
                        <execution>
                            <id>tag-version</id>
                            <goals>
                                <goal>build</goal>
                                <goal>tag</goal>
                                <goal>push</goal>
                            </goals>
                            <configuration>
                                <tag>${project.version}</tag>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                            <goal>test-jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-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-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-banned-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>org.springframework.boot:spring-boot-starter-logging</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.ekryd.sortpom</groupId>
                <artifactId>sortpom-maven-plugin</artifactId>
                <version>${sortpom-maven-plugin.version}</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <keepBlankLines>true</keepBlankLines>
                    <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
                    <sortDependencies>scope</sortDependencies>
                    <lineSeparator>\n</lineSeparator>
                    <nrOfIndentSpace>4</nrOfIndentSpace>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
                <configuration>
                    <skip>${env.MAVEN_DEPLOY_SKIP}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
