<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>tools.bestquality</groupId>
        <artifactId>ossrh-parent</artifactId>
        <version>0.0.17</version>
    </parent>

    <artifactId>ci-maven-plugin</artifactId>
    <version>0.0.20</version>
    <packaging>maven-plugin</packaging>
    <name>CI Maven Plugin</name>
    <description>Maven plugin for building and releasing from CI pipelines</description>

    <properties>
        <!-- Project properties -->
        <ossrh.hostname>s01.oss.sonatype.org</ossrh.hostname>
        <ossrh.staging-profile>7e430683fef886</ossrh.staging-profile>
        <repository.slug>Best-Quality-Engineering/ci-maven-plugin</repository.slug>
        <revision>0.0.20</revision>
        <sha1/>
        <changelist/>
        <!-- Maven specific properties -->
        <maven.version>3.2.5</maven.version>
        <maven.plugin-annotations.version>3.6.4</maven.plugin-annotations.version>
        <maven.plugin-plugin.version>3.6.4</maven.plugin-plugin.version>
        <!-- Dependency versions -->
        <assertj.version>3.23.1</assertj.version>
        <byte-buddy.version>1.12.19</byte-buddy.version>
        <groovy.version>3.0.13</groovy.version>
        <junit.jupiter.version>5.9.0</junit.jupiter.version>
        <maven-itf.version>0.11.0</maven-itf.version>
        <objenesis.version>3.2</objenesis.version>
        <spock.version>2.3-groovy-3.0</spock.version>
        <slf4j.version>1.7.5</slf4j.version>
        <!-- Plugin versions -->
        <maven.ci.version>0.0.19</maven.ci.version>
        <maven.scm-publish.version>3.1.0</maven.scm-publish.version>
        <maven.gmaven.version>1.13.1</maven.gmaven.version>
        <nexus.staging.version>1.6.12</nexus.staging.version>
        <!-- Site properties -->
        <maven.site.version>3.12.0</maven.site.version>
        <site.fluido-skin.version>1.10.0</site.fluido-skin.version>
        <site.maven.plugin>0.12</site.maven.plugin>
    </properties>

    <prerequisites>
        <maven>${maven.version}</maven>
    </prerequisites>

    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
            <type>pom</type>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Compile Dependencies -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven.plugin-annotations.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
            <version>${objenesis.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy</artifactId>
            <version>${byte-buddy.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>${spock.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Maven ITF dependencies -->
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.soebes.itf.jupiter.extension</groupId>
            <artifactId>itf-assertj</artifactId>
            <version>${maven-itf.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.soebes.itf.jupiter.extension</groupId>
            <artifactId>itf-jupiter-extension</artifactId>
            <version>${maven-itf.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>tools.bestquality</groupId>
                <artifactId>ci-maven-plugin</artifactId>
                <configuration>
                    <documents>
                        <document>
                            <location>${project.basedir}/README.md</location>
                            <encoding>utf-8</encoding>
                            <pattern><![CDATA[(?sm)(<artifactId>ci-maven-plugin<\/artifactId>\s+<version>).*?(<\/version>)]]></pattern>
                            <replacement><![CDATA[$1${project.version}$2]]></replacement>
                        </document>
                        <document>
                            <location>${project.basedir}/CONTRIBUTING.md</location>
                            <encoding>utf-8</encoding>
                            <pattern><![CDATA[(?sm)(<artifactId>ci-maven-plugin<\/artifactId>\s+<version>).*?(<\/version>)]]></pattern>
                            <replacement><![CDATA[$1${project.version}$2]]></replacement>
                        </document>
                        <document>
                            <location>${project.basedir}/docs/_config.yml</location>
                            <encoding>utf-8</encoding>
                            <pattern><![CDATA[(version:).*]]></pattern>
                            <replacement><![CDATA[$1 ${project.version}]]></replacement>
                        </document>
                        <document>
                            <location>${project.basedir}/pom.xml</location>
                            <encoding>utf-8</encoding>
                            <pattern><![CDATA[(<maven.ci.version>).*(<\/maven.ci.version>)]]></pattern>
                            <replacement><![CDATA[$1${project.version}$2]]></replacement>
                        </document>
                    </documents>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>${maven.gmaven.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>execute</goal>
                            <goal>addSources</goal>
                            <goal>addTestSources</goal>
                            <goal>generateStubs</goal>
                            <goal>compile</goal>
                            <goal>generateTestStubs</goal>
                            <goal>compileTests</goal>
                            <goal>removeStubs</goal>
                            <goal>removeTestStubs</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                        <version>${groovy.version}</version>
                        <type>pom</type>
                        <exclusions>
                            <exclusion>
                                <groupId>org.codehaus.groovy</groupId>
                                <artifactId>groovy-testng</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${maven.plugin-plugin.version}</version>
                <configuration>
                    <goalPrefix>ci</goalPrefix>
                </configuration>
                <executions>
                    <execution>
                        <id>generated-helpmojo</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <skip>${skipITests}</skip>
                    <skipITs>${skipITests}</skipITs>
                    <skipTests>${skipITests}</skipTests>
                    <argLine>${failsafe.jacoco.args}</argLine>
                    <parallel>classes</parallel>
                    <threadCount>5</threadCount>
                    <systemProperties>
                        <maven.version>${maven.version}</maven.version>
                        <maven.home>${maven.home}</maven.home>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.soebes.itf.jupiter.extension</groupId>
                <artifactId>itf-maven-plugin</artifactId>
                <version>${maven-itf.version}</version>
                <executions>
                    <execution>
                        <id>installing</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>install</goal>
                            <goal>resources-its</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.github</groupId>
                <artifactId>site-maven-plugin</artifactId>
                <version>${site.maven.plugin}</version>
                <configuration>
                    <message>Creating site for ${project.version}</message>
                    <noJekyll>true</noJekyll>
                    <!-- scopes: [public_repo, user:email] -->
                    <oauth2Token>${env.SITE_TOKEN}</oauth2Token>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>site</goal>
                        </goals>
                        <phase>site</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-publish-plugin</artifactId>
                <version>${maven.scm-publish.version}</version>
                <configuration>
                    <scmBranch>gh-pages</scmBranch>
                </configuration>
            </plugin>
        </plugins>
    </build>

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

</project>
