<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.toolisticon.cute</groupId>
    <artifactId>cute-parent</artifactId>
    <version>0.12.0</version>
    <packaging>pom</packaging>

    <name>cute-parent</name>
    <description>Please refer to https://github.com/toolisticon/cute</description>
    <url>https://github.com/toolisticon/cute</url>

    <modules>

        <!-- modules -->
        <module>extension</module>
        <module>cute</module>
        <module>integration-test</module>

        <module>coverage</module>

    </modules>

    <parent>
        <groupId>io.toolisticon.maven</groupId>
        <artifactId>maven-oss-parent-for-github</artifactId>
        <version>0.0.2</version>
    </parent>

    <organization>
        <name>Holisticon AG</name>
        <url>http://www.holisticon.de/</url>
    </organization>
    <developers>
        <developer>
            <name>Tobias Stamann</name>
            <email>tobias.stamann@holisticon.de</email>
            <organization>Holisticon AG</organization>
            <organizationUrl>http://holisticon.de/</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT</name>
            <url>
                https://en.wikipedia.org/wiki/MIT_License
            </url>
            <comments>s. LICENSE file</comments>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <inceptionYear>2018</inceptionYear>

    <prerequisites>
        <maven>3.6.0</maven>
    </prerequisites>


    <issueManagement>
        <url>https://github.com/toolisticon/cute/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <scm>
        <connection>scm:git:git@github.com:toolisticon/cute.git</connection>
        <developerConnection>scm:git:git@github.com:toolisticon/cute.git</developerConnection>
        <url>git@github.com:toolisticon/cute.git</url>
        <tag>cute-parent-0.8.0</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
        <encoding>UTF-8</encoding>

        <java.version>1.7</java.version>

        <java.compile.source.version>1.7</java.compile.source.version>
        <java.compile.target.version>1.7</java.compile.target.version>

        <!-- dependencies: compile and runtime -->
        <spiap.version>0.8.0</spiap.version>

        <!-- versions of test dependencies -->
        <junit4.version>4.13.1</junit4.version>
        <junit5.version>5.3.1</junit5.version>
        <testng.version>6.14.3</testng.version>

        <hamcrest.version>2.2</hamcrest.version>
        <mockito.version>2.28.2</mockito.version>

        <!-- plugin versions -->
        <animal-sniffer-maven-plugin.version>1.17</animal-sniffer-maven-plugin.version>
        <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
        <maven-assembly-plugin.version>2.4</maven-assembly-plugin.version>
        <maven-bundle-plugin.version>2.5.3</maven-bundle-plugin.version>
        <maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
        <maven-processor-plugin.version>2.2.4</maven-processor-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>


        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>


    </properties>


    <build>
        <defaultGoal>clean install</defaultGoal>
        <plugins>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>

                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.0.4,)</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${java.version}</version>
                                </requireJavaVersion>
                                <bannedDependencies>
                                    <searchTransitive>false</searchTransitive>
                                    <excludes>
                                        <exclude>*</exclude>
                                    </excludes>
                                    <includes>
                                        <include>io.toolisticon.cute:*</include>
                                        <include>*:*:*:*:test:*</include>
                                        <include>*:*:*:*:provided:*</include>
                                    </includes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>${coveralls-maven-plugin.version}</version>
                <configuration>
                    <repoToken>${COVERALL_TOKEN}</repoToken>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.compile.source.version}</source>
                    <target>${java.compile.target.version}</target>
                </configuration>
            </plugin>


        </plugins>
        <pluginManagement>
            <plugins>


                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${java.compile.source.version}</source>
                        <target>${java.compile.target.version}</target>
                    </configuration>
                </plugin>


                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <configuration>
                        <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                    </configuration>
                </plugin>


                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                </plugin>

                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>

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

                <!-- gitflow -->
                <plugin>
                    <groupId>com.amashchenko.maven.plugin</groupId>
                    <artifactId>gitflow-maven-plugin</artifactId>
                    <version>1.14.0</version>
                    <configuration>
                        <gitFlowConfig>
                            <productionBranch>master</productionBranch>
                            <developmentBranch>develop</developmentBranch>
                            <featureBranchPrefix>feature/</featureBranchPrefix>
                            <releaseBranchPrefix>release/</releaseBranchPrefix>
                            <hotfixBranchPrefix>hotfix/</hotfixBranchPrefix>
                            <supportBranchPrefix>support/</supportBranchPrefix>
                            <origin>origin</origin>
                        </gitFlowConfig>
                        <useSnapshotInHotfix>true</useSnapshotInHotfix>
                        <useSnapshotInRelease>true</useSnapshotInRelease>
                        <keepBranch>false</keepBranch>
                        <pushRemote>true</pushRemote>
                    </configuration>
                </plugin>

                <!-- To sign the artifacts -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                    <configuration>
                        <keyname>${gpg.keyname}</keyname>
                        <gpgArguments>
                            <arg>--batch</arg>
                            <arg>--yes</arg>
                            <arg>--pinentry-mode</arg>
                            <arg>loopback</arg>
                        </gpgArguments>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                    <configuration>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        <serverId>sonatype-nexus-staging</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-deploy</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>deploy</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <source>8</source>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>checkstyle</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <version>3.0.0</version>
                        <configuration>
                            <xmlOutput>true</xmlOutput>
                            <findbugsXmlOutput>true</findbugsXmlOutput>
                            <!--<findbugsXmlWithMessages>true</findbugsXmlWithMessages>-->
                            <excludeFilterFile>config/findbugs-excludes.xml</excludeFilterFile>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>2.12.1</version>
                        <executions>
                            <execution>
                                <id>validate</id>
                                <phase>validate</phase>
                                <configuration>
                                    <configLocation>${session.executionRootDirectory}/config/sun_checks.xml
                                    </configLocation>
                                    <encoding>UTF-8</encoding>
                                    <consoleOutput>true</consoleOutput>
                                    <failOnViolation>true</failOnViolation>
                                    <failsOnError>true</failsOnError>
                                    <violationSeverity>warn</violationSeverity>
                                </configuration>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <version>3.3</version>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>ReleaseJavadoc</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <reportOutputDirectory>${project.basedir}/docs/assets/javadoc</reportOutputDirectory>
                            <destDir>${project.version}</destDir>
                            <excludePackageNames>io.toolisticon.example.*</excludePackageNames>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

        </profile>

        <profile>
            <id>jdksmallerthan9</id>
            <activation>
                <jdk>[1.6,9)</jdk>
            </activation>


            <build>

                <plugins>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>animal-sniffer-maven-plugin</artifactId>
                        <version>${animal-sniffer-maven-plugin.version}</version>

                        <configuration>
                            <excludeDependencies>
                                <excludeDependency>io.toolisticon.cute:extension-modulesupport:*
                                </excludeDependency>
                            </excludeDependencies>
                        </configuration>


                        <executions>

                            <execution>
                                <id>check_java17</id>

                                <phase>test</phase>

                                <goals>
                                    <goal>check</goal>
                                </goals>

                                <configuration>

                                    <signature>
                                        <groupId>org.codehaus.mojo.signature</groupId>
                                        <artifactId>java17</artifactId>
                                        <version>1.0</version>
                                    </signature>

                                </configuration>

                            </execution>

                        </executions>


                    </plugin>

                </plugins>


            </build>
        </profile>

        <profile>
            <id>jdkgreaterthan8</id>
            <activation>
                <jdk>[9,20)</jdk>
            </activation>


            <build>

                <plugins>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>animal-sniffer-maven-plugin</artifactId>
                        <version>${animal-sniffer-maven-plugin.version}</version>

                        <configuration>
                            <excludeDependencies>
                                <excludeDependency>io.toolisticon.cute:extension-modulesupport:*
                                </excludeDependency>
                            </excludeDependencies>
                        </configuration>

                        <executions>

                            <execution>
                                <id>check_biggerThanJava18</id>

                                <phase>test</phase>

                                <goals>
                                    <goal>check</goal>
                                </goals>

                                <configuration>

                                    <signature>
                                        <groupId>org.codehaus.mojo.signature</groupId>
                                        <artifactId>java17</artifactId>
                                        <version>1.0</version>
                                    </signature>


                                </configuration>

                            </execution>

                        </executions>


                    </plugin>

                </plugins>


            </build>
        </profile>
        <!--
            Profile creating all artifacts: JARs, POMs, Sources, JavaDoc and all signatures.
        -->
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>


    </profiles>

    <dependencies>


        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>

            <!-- internal -->
            <dependency>
                <groupId>io.toolisticon.cute</groupId>
                <artifactId>cute</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.toolisticon.cute</groupId>
                <artifactId>extension-parent</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.toolisticon.cute</groupId>
                <artifactId>extension-api</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.toolisticon.cute</groupId>
                <artifactId>extension-plainjava</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.toolisticon.cute</groupId>
                <artifactId>extension-modulesupport</artifactId>
                <version>${project.version}</version>
            </dependency>


            <!-- Test dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit4.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- 3rd party -->
            <dependency>
                <groupId>io.toolisticon.spiap</groupId>
                <artifactId>spiap-api</artifactId>
                <version>${spiap.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.toolisticon.spiap</groupId>
                <artifactId>spiap-processor</artifactId>
                <version>${spiap.version}</version>
                <scope>provided</scope>
            </dependency>


        </dependencies>
    </dependencyManagement>


</project>
