247c5444创建于 2月22日历史提交
<?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>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.5.11</version>
        <!-- To skip the local file search and directly search the parent POM in Maven repositories -->
        <relativePath/>
    </parent>

    <groupId>im.turms</groupId>
    <artifactId>turms-parent</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>

    <name>${project.artifactId}</name>
    <url>https://github.com/turms-im/turms</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <!-- Project -->
        <java.version>25</java.version>
        <revision>0.10.0-SNAPSHOT</revision>

        <!-- Runtime Deps -->
        <awssdk.version>2.31.68</awssdk.version>
        <blockhound.version>1.0.13.RELEASE</blockhound.version>
        <disruptor.version>4.0.0</disruptor.version>
        <eclipse-collections.version>12.0.0</eclipse-collections.version>
        <graalvm.version>25.0.2</graalvm.version>
        <icu4j.version>77.1</icu4j.version>
        <jctools-core.version>4.0.5</jctools-core.version>
        <log4j.version>2.25.0</log4j.version>
        <protobuf.version>4.31.1</protobuf.version>
        <swagger.version>2.2.31</swagger.version>
        <swagger-ui.version>5.25.2</swagger-ui.version>

        <!-- Runtime Deps for Testing -->
        <jmh.version>1.37</jmh.version>
        <playwright.version>1.52.0</playwright.version>
        <testcontainers.version>1.21.2</testcontainers.version>

        <!-- Maven plugins -->
        <checkstyle.version>10.25.0</checkstyle.version>
        <flatten-maven-plugin.version>1.7.0</flatten-maven-plugin.version>
        <git-commit-id-maven-plugin.version>9.0.2</git-commit-id-maven-plugin.version>
        <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <!-- spring-boot-starter-parent sets it to "<maven.compiler.release>${java.version}</maven.compiler.release>",
        so we set it to empty to not compile with "release" to use Java internal APIs  -->
        <maven.compiler.release/>
        <maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
        <maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>3.5.3</maven-failsafe-plugin.version>
        <os-maven-plugin.version>1.7.1</os-maven-plugin.version>
        <protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
        <spotbugs-maven-plugin.version>4.9.3.0</spotbugs-maven-plugin.version>
        <spotless-maven-plugin.version>2.44.5</spotless-maven-plugin.version>
        <spotless-maven-plugin.eclipse.version>4.35</spotless-maven-plugin.eclipse.version>
        <spring-boot-thin-layout.version>1.0.31.RELEASE</spring-boot-thin-layout.version>

        <!-- Configs -->
        <skipITs>false</skipITs>
        <skipUTs>false</skipUTs>
    </properties>

    <modules>
        <!-- Aggregation -->
        <module>turms-client-kotlin</module>

        <module>turms-plugin-demo</module>

        <!-- Inheritance -->
        <module>turms-server-common</module>
        <module>turms-server-test-common</module>

        <module>turms-ai-serving</module>
        <module>turms-gateway</module>
        <module>turms-service</module>

        <module>turms-plugins/turms-plugin-antispam</module>
        <module>turms-plugins/turms-plugin-livekit</module>
        <module>turms-plugins/turms-plugin-minio</module>
        <module>turms-plugins/turms-plugin-push</module>
        <module>turms-plugins/turms-plugin-rasa</module>

        <module>turms-server-test</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- pom -->
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testcontainers.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>bom</artifactId>
                <version>${awssdk.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Turms -->
            <dependency>
                <groupId>im.turms</groupId>
                <artifactId>server-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>im.turms</groupId>
                <artifactId>turms-gateway</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>im.turms</groupId>
                <artifactId>turms-service</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- OpenAPI -->
            <dependency>
                <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-core-jakarta</artifactId>
                <version>${swagger.version}</version>
            </dependency>
            <dependency>
                <groupId>org.webjars</groupId>
                <artifactId>swagger-ui</artifactId>
                <version>${swagger-ui.version}</version>
            </dependency>

            <!-- Diagnostics -->
            <dependency>
                <groupId>io.projectreactor.tools</groupId>
                <artifactId>blockhound</artifactId>
                <version>${blockhound.version}</version>
            </dependency>

            <!-- Plugin -->
            <dependency>
                <groupId>org.graalvm.tools</groupId>
                <artifactId>chromeinspector-tool</artifactId>
                <version>${graalvm.version}</version>
            </dependency>
            <dependency>
                <groupId>org.graalvm.js</groupId>
                <artifactId>js</artifactId>
                <version>${graalvm.version}</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.graalvm.polyglot</groupId>
                <artifactId>polyglot</artifactId>
                <version>${graalvm.version}</version>
            </dependency>

            <!-- Miscellaneous -->
            <dependency>
                <groupId>com.lmax</groupId>
                <artifactId>disruptor</artifactId>
                <version>${disruptor.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.collections</groupId>
                <artifactId>eclipse-collections-api</artifactId>
                <version>${eclipse-collections.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.collections</groupId>
                <artifactId>eclipse-collections</artifactId>
                <version>${eclipse-collections.version}</version>
            </dependency>
            <dependency>
                <groupId>com.ibm.icu</groupId>
                <artifactId>icu4j</artifactId>
                <version>${icu4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jctools</groupId>
                <artifactId>jctools-core</artifactId>
                <version>${jctools-core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java-util</artifactId>
                <version>${protobuf.version}</version>
            </dependency>

            <!-- Testing -->
            <dependency>
                <groupId>im.turms</groupId>
                <artifactId>server-test-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-core</artifactId>
                <version>${jmh.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-generator-annprocess</artifactId>
                <version>${jmh.version}</version>
            </dependency>
            <dependency>
                <groupId>com.microsoft.playwright</groupId>
                <artifactId>playwright</artifactId>
                <version>${playwright.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>checkstyle</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>${maven-checkstyle-plugin.version}</version>
                        <configuration>
                            <configLocation>codequality/checkstyle.xml</configLocation>
                            <headerLocation>codequality/checkstyle-header.txt</headerLocation>
                            <consoleOutput>true</consoleOutput>
                            <failOnViolation>true</failOnViolation>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>com.puppycrawl.tools</groupId>
                                <artifactId>checkstyle</artifactId>
                                <version>${checkstyle.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>checkstyle-validation</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>io.github.git-commit-id</groupId>
                    <artifactId>git-commit-id-maven-plugin</artifactId>
                    <version>${git-commit-id-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.xolstice.maven.plugins</groupId>
                    <artifactId>protobuf-maven-plugin</artifactId>
                    <version>${protobuf-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>flatten-maven-plugin</artifactId>
                <version>${flatten-maven-plugin.version}</version>
                <configuration>
                    <updatePomFile>true</updatePomFile>
                    <flattenMode>resolveCiFriendliesOnly</flattenMode>
                </configuration>
                <executions>
                    <execution>
                        <id>flatten</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>flatten</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>flatten.clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${spotbugs-maven-plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless-maven-plugin.version}</version>
                <configuration>
                    <java>
                        <includes>
                            <include>src/main/java/**/*.java</include>
                            <include>src/test/java/**/*.java</include>
                        </includes>
                        <excludes>
                            <exclude>src/main/java/im/turms/plugin/antispam/core/character/data/*.java</exclude>
                        </excludes>
                        <eclipse>
                            <version>${spotless-maven-plugin.eclipse.version}</version>
                            <file>./codequality/eclipse.xml</file>
                        </eclipse>
                        <trimTrailingWhitespace/>
                        <removeUnusedImports/>
                        <importOrder>
                            <!-- 1. An empty string for all the imports that didn't specify explicitly,
                            2. '|' for joining a group without blank line,
                            3. '\#' prefix for static imports. -->
                            <order>java|javax|jakarta,,im.turms,\#java|\#javax|\#jakarta,\#,\#im.turms</order>
                        </importOrder>
                        <licenseHeader>
                            <file>./codequality/java-license-header.txt</file>
                        </licenseHeader>
                    </java>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <!-- Activate the use of TCP to transmit events to the plugin -->
                    <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
                    <includes>
                        <include>**/*Tests.java</include>
                    </includes>
                    <skipTests>${skipUTs}</skipTests>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <configuration>
                    <!-- Activate the use of TCP to transmit events to the plugin -->
                    <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
                    <includes>
                        <include>**/*IT.java</include>
                        <include>**/*ST.java</include>
                    </includes>
                    <skipITs>${skipITs}</skipITs>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>