<?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.gitee.ygypc</groupId>
    <artifactId>tulang-datasource</artifactId>
    <packaging>pom</packaging>
    <version>1.0.1</version>
    <modules>
        <module>datasource-context</module>
        <module>tenant-datasource</module>
    </modules>
    
    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-compiler.version>3.3</maven-compiler.version>
        <maven-source.version>3.0.1</maven-source.version>
        <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
        <maven-jxr-plugin.version>3.0.0</maven-jxr-plugin.version>
        <maven-pmd-plugin.version>3.14.0</maven-pmd-plugin.version>
        <p3c-pmd.version>2.1.1</p3c-pmd.version>
        <spring.version>6.1.4</spring.version>
    </properties>
    <name>${project.groupId}:${project.artifactId}</name>
    <description>
        租户数据源 解决方案
    </description>
    <url>https://gitee.com/ygypc/tulang-datasource.git</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>
            <name>Rubens</name>
            <email>ygypc_spring@foxmail.com</email>
            <organization>Rubens</organization>
            <organizationUrl>https://gitee.com/ygypc/</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:https://gitee.com/ygypc/tulang-datasource.git</connection>
        <developerConnection>scm:git:git@gitee.com:ygypc/tulang-datasource.git</developerConnection>
        <url>https://gitee.com/ygypc/tulang-datasource.git</url>
    </scm>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${spring.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.gitee.ygypc</groupId>
                <artifactId>datasource-context</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.gitee.ygypc</groupId>
                <artifactId>tenant-datasource</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.30</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <!-- 配置GPG插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifactId</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
                <!-- 添加以下配置 -->
                <configuration>
                    <executable>gpg</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.6.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central_sonatype</publishingServerId>
                    <waitUntil>uploaded</waitUntil>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <java>
                        <!-- 使用 Google Java Format -->
                        <googleJavaFormat>
                            <version>1.28.0</version>
                            <style>GOOGLE</style>
                            <!-- 可选: GOOGLE 或 AOSP -->
                        </googleJavaFormat>
                        <!-- 自动移除未使用的 import -->
                        <removeUnusedImports/>
                        <!-- 修剪行尾空格 -->
                        <trimTrailingWhitespace/>
                        <!-- 可选：自定义行尾为 LF（Unix 风格） -->
                        <endWithNewline/>
                    </java>
                    <yaml>
                        <includes>
                            <include>src/**/*.yml</include>
                            <include>src/**/*.yaml</include>
                        </includes>
                        <endWithNewline/>
                        <trimTrailingWhitespace/>
                    </yaml>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>apply</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source.version}</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
                <!--  <executions>
                              <execution>
                                  <goals>
                                  <goal>update-dependency</goal>
                                  </goals>
                              </execution>
                          </executions>-->
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.theoryinpractise</groupId>
                <artifactId>googleformatter-maven-plugin</artifactId>
                <version>1.7.5</version>
                <executions>
                    <execution>
                        <id>reformat-sources</id>
                        <configuration>
                            <includeStale>false</includeStale>
                            <!--<style>AOSP</style>-->
                            <style>GOOGLE</style>
                            <formatMain>true</formatMain>
                            <formatTest>true</formatTest>
                            <filterModified>false</filterModified>
                            <skip>false</skip>
                            <fixImports>true</fixImports>
                            <maxLineLength>160</maxLineLength>
                        </configuration>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <distributionManagement>
        <snapshotRepository>
            <id>central_sonatype</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>central_sonatype</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>