<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.github.yingzhuo</groupId>
    <artifactId>spring-turbo</artifactId>
    <version>3.0.6</version>
    <packaging>jar</packaging>

    <url>https://github.com/yingzhuo/spring-turbo</url>
    <description>Another enhancement library of SpringBoot/SpringFramework. Have fun.</description>

    <scm>
        <tag>main</tag>
        <url>git@github.com:yingzhuo/spring-turbo.git</url>
        <connection>scm:git:git@github.com:yingzhuo/spring-turbo.git</connection>
        <developerConnection>scm:git:git@github.com:yingzhuo/spring-turbo.git</developerConnection>
    </scm>

    <developers>
        <developer>
            <id>yingzhuo</id>
            <name>應卓</name>
            <email>yingzhor@gmail.com</email>
            <roles>
                <role>Owner</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

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

    <distributionManagement>
        <repository>
            <id>oss-release</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>oss-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/yingzhuo/spring-turbo/issues</url>
    </issueManagement>

    <repositories>
        <repository>
            <id>sonatype-public</id>
            <name>Sonatype Maven Repository</name>
            <url>https://oss.sonatype.org/content/repositories/public</url>
        </repository>
        <repository>
            <id>sonatype-snapshots</id>
            <name>Sonatype Maven Repository Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
        </repository>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <properties>
        <encoding>UTF-8</encoding>
        <java.version>17</java.version>

        <spring.boot.version>3.0.6</spring.boot.version>
        <lombok.version>1.18.26</lombok.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- springboot -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-json</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- springframework -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- spring-security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-crypto</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- jakarta-servlet-api -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- jsr305 -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}-${project.version}</finalName>

        <resources>
            <resource>
                <directory>${project.basedir}/src/main/java</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/.gitkeep</exclude>
                    <exclude>**/*.bak</exclude>
                    <exclude>**/*.java</exclude>
                    <exclude>**/*.kt</exclude>
                    <exclude>**/*.groovy</exclude>
                    <exclude>**/*.scala</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/.gitkeep</exclude>
                    <exclude>**/*.bak</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <!-- setup构建时间戳变量 (helper.build.timestamp) -->
                    <!--
                    <execution>
                        <id>setup-buildts-var</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>timestamp-property</goal>
                        </goals>
                        <configuration>
                            <name>helper.build.timestamp</name>
                            <pattern>yyyyMMddHHmm</pattern>
                            <timeZone>Asia/Shanghai</timeZone>
                            <locale>zh_CN</locale>
                        </configuration>
                    </execution>
                    -->
                    <!-- setup构建根目录变量 (helper.build.root) -->
                    <execution>
                        <id>setup-rootlocation-var</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>rootlocation</goal>
                        </goals>
                        <configuration>
                            <rootLocationProperty>helper.build.root</rootLocationProperty>
                            <runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
                        </configuration>
                    </execution>
                    <!-- setup Maven版本号 (helper.build.mavenversion) -->
                    <execution>
                        <id>setup-mavenversion-var</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>maven-version</goal>
                        </goals>
                        <configuration>
                            <versionProperty>helper.build.mavenversion</versionProperty>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <debug>false</debug>
                    <encoding>${encoding}</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <parameters>true</parameters>
                    <compilerArgs>
                        <!--
                        <arg>-verbose</arg>
                        -->
                        <arg>-Xlint:deprecation,unchecked</arg>
                    </compilerArgs>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                        <path>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-configuration-processor</artifactId>
                            <version>${spring.boot.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>copy-license-file</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <target>
                                <copy todir="${project.build.directory}/classes/META-INF">
                                    <fileset dir="${helper.build.root}" includes="LICENSE.txt NOTICE.txt"/>
                                </copy>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <compress>true</compress>
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                            <addClasspath>false</addClasspath>
                            <addDefaultEntries>true</addDefaultEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
                            <addExtensions>false</addExtensions>
                        </manifest>
                        <manifestEntries/>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.5.0</version>
                <configuration>
                    <encoding>${encoding}</encoding>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>native2ascii-maven-plugin</artifactId>
                <version>2.0.1</version>
                <executions>
                    <execution>
                        <id>native2ascii-utf8-properties</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>inplace</goal>
                        </goals>
                        <configuration>
                            <dir>${project.build.directory}/classes</dir>
                            <includes>**/*.properties</includes>
                            <encoding>UTF-8</encoding>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.1</version>
                <configuration/>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <skipTests>false</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <compilerSource>${java.version}</compilerSource>
                    <compilerCompliance>${java.version}</compilerCompliance>
                    <compilerTargetPlatform>${java.version}</compilerTargetPlatform>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sonar</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>