<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>de.malkusch.parent</groupId>
    <artifactId>oss-parent</artifactId>
    <version>3.0.30</version>
    <packaging>pom</packaging>

    <name>OSS Parent</name>
    <description>Parent POM for my open source projects</description>

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

    <profiles>
        <profile>
            <id>oss-parent-test</id>
            <modules>
                <module>test</module>
            </modules>
        </profile>

        <profile>
            <id>update-readme</id>
            <activation>
                <file>
                    <exists>README.md</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-release-plugin</artifactId>
                        <configuration>
                            <preparationGoals>-DskipTests clean verify replacer:replace scm:checkin -Dmessage="Update Readme"
                                -DpushChanges=false -Dincludes=README.md
                            </preparationGoals>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>com.google.code.maven-replacer-plugin</groupId>
                        <artifactId>replacer</artifactId>
                        <version>1.5.3</version>
                        <configuration>
                            <ignoreMissingFile>true</ignoreMissingFile>
                            <file>README.md</file>
                            <regexFlags>
                                <regexFlag>MULTILINE</regexFlag>
                                <regexFlag>DOTALL</regexFlag>
                            </regexFlags>
                            <token>```xml maven.*?```</token>
                            <value><![CDATA[```xml maven
<dependency>
  <groupId>${project.groupId}</groupId>
  <artifactId>${project.artifactId}</artifactId>
  <version>${project.version}</version>
</dependency>
```]]></value>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>maven-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.4.0</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.12.0</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>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <url>https://github.com/malkusch/${project.artifactId}</url>

    <scm>
        <connection>scm:git:${project.scm.url}</connection>
        <developerConnection>scm:git:${project.scm.url}</developerConnection>
        <url>https://github.com/malkusch/${project.artifactId}</url>
        <tag>oss-parent-3.0.30</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>central</id>
            <url>https://central.sonatype.com</url>
        </repository>
    </distributionManagement>

    <issueManagement>
        <system>github</system>
        <url>https://github.com/malkusch/${project.artifactId}/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>WTFPL, Version 2.0</name>
            <url>http://www.wtfpl.net/txt/copying/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>malkusch</id>
            <name>Markus Malkusch</name>
            <email>markus@malkusch.de</email>
            <url>http://markus.malkusch.de/</url>
            <timezone>2</timezone>
        </developer>
    </developers>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>6.0.1</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>5.21.0</version>
            </dependency>
            <dependency>
                <groupId>org.wiremock</groupId>
                <artifactId>wiremock</artifactId>
                <version>3.13.2</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.9.0</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependency-info</report>
                            <report>scm</report>
                            <report>issue-tracking</report>
                            <report>project-team</report>
                            <report>license</report>
                            <report>index</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.4</version>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.5.4</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>4.0.0-M16</version>
                <configuration>
                    <skipDeploy>true</skipDeploy>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.github</groupId>
                <artifactId>site-maven-plugin</artifactId>
                <version>0.12</version>
                <configuration>
                    <server>github</server>
                    <message>Site for ${project.artifactId}-${project.version}</message>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>site</goal>
                        </goals>
                        <phase>site-deploy</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.2</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6.3</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <releaseProfiles>maven-release</releaseProfiles>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
