<?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.github.creek91</groupId>
  <artifactId>monodula</artifactId>
  <version>${revision}</version>
  <packaging>pom</packaging>

  <name>Monodula</name>
  <description>A modular monolith framework with zero-code splitting for Spring Boot</description>
  <url>https://github.com/creek91/monodula</url>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>creek91</id>
      <name>Creek91</name>
      <email>hebin.ck@foxmail.com</email>
      <roles>
        <role>Lead Developer</role>
      </roles>
    </developer>
  </developers>

  <modules>
    <module>monodula-maven-plugin</module>
    <module>monodula-archunit</module>
    <module>monodula-archetype</module>
  </modules>

  <scm>
    <connection>scm:git:git://github.com/creek91/monodula.git</connection>
    <developerConnection>scm:git:git@github.com:creek91/monodula.git</developerConnection>
    <url>https://github.com/creek91/monodula/tree/main</url>
  </scm>

  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/creek91/monodula/issues</url>
  </issueManagement>

  <ciManagement>
    <system>GitHub Actions</system>
    <url>https://github.com/creek91/monodula/actions</url>
  </ciManagement>

  <properties>
    <revision>1.0.3</revision>
    <maven.compiler.release>17</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven-plugin-api.version>3.9.6</maven-plugin-api.version>
    <maven-plugin-annotations.version>3.11.0</maven-plugin-annotations.version>
    <archunit-junit5.version>1.4.1</archunit-junit5.version>
    <junit-jupiter.version>5.10.2</junit-jupiter.version>
    <assertj-core.version>3.25.3</assertj-core.version>
    <checkstyle.version>10.21.4</checkstyle.version>
    <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
    <spotless.version>2.43.0</spotless.version>
    <spring-boot.version>3.5.14</spring-boot.version>
    <snakeyaml.version>2.3</snakeyaml.version>
    <maven-plugin-plugin.version>3.11.0</maven-plugin-plugin.version>
    <maven-archetype.version>3.2.1</maven-archetype.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${maven-plugin-api.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${maven-plugin-api.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>${maven-plugin-annotations.version}</version>
      </dependency>
      <dependency>
        <groupId>com.tngtech.archunit</groupId>
        <artifactId>archunit-junit5</artifactId>
        <version>${archunit-junit5.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${junit-jupiter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj-core.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot</artifactId>
        <version>${spring-boot.version}</version>
      </dependency>
      <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
        <version>${snakeyaml.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.12.1</version>
          <configuration>
            <encoding>UTF-8</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.4.1</version>
          <executions>
            <execution>
              <id>enforce-java</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireJavaVersion>
                    <version>[17,)</version>
                    <message>Monodula requires Java 17 or higher. Current JDK is too old.</message>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.2.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven-checkstyle-plugin.version}</version>
          <configuration>
            <configLocation>config/checkstyle/checkstyle.xml</configLocation>
            <consoleOutput>true</consoleOutput>
            <failsOnError>true</failsOnError>
            <includeTestSourceDirectory>true</includeTestSourceDirectory>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${checkstyle.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>checkstyle</id>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless.version}</version>
          <configuration>
            <java>
              <googleJavaFormat>
                <version>1.22.0</version>
                <style>AOSP</style>
              </googleJavaFormat>
              <removeUnusedImports/>
              <trimTrailingWhitespace/>
              <endWithNewline/>
            </java>
            <pom>
              <sortPom>
                <encoding>UTF-8</encoding>
                <lineSeparator>\n</lineSeparator>
                <expandEmptyElements>false</expandEmptyElements>
                <spaceBeforeCloseEmptyElement>false</spaceBeforeCloseEmptyElement>
              </sortPom>
            </pom>
          </configuration>
          <executions>
            <execution>
              <id>spotless-check</id>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.3.1</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.7.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.4</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <goals>
                <goal>sign</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>0.7.0</version>
          <extensions>true</extensions>
          <configuration>
            <publishingServerId>central</publishingServerId>
            <autoPublish>true</autoPublish>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${maven-plugin-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-archetype-plugin</artifactId>
          <version>${maven-archetype.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>flatten-maven-plugin</artifactId>
          <version>1.6.0</version>
          <configuration>
            <flattenMode>ossrh</flattenMode>
          </configuration>
          <executions>
            <execution>
              <id>flatten</id>
              <goals>
                <goal>flatten</goal>
              </goals>
              <phase>process-resources</phase>
            </execution>
            <execution>
              <id>flatten.clean</id>
              <goals>
                <goal>clean</goal>
              </goals>
              <phase>clean</phase>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-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-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
