<?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>cn.xuqiudong.basic</groupId>
    <artifactId>lcxm-cas-sso</artifactId>
    <version>1.0.0-2024</version>
    <packaging>pom</packaging>

    <name>lcxm-cas-sso</name>
    <description>基于cas的sso编码实现</description>
    <url>https://gitee.com/basic-support/lcxm-cas-sso</url>
    
    <modules>
        <module>lcxm-cas-sso-common</module>
        <module>lcxm-cas-sso-client</module>
        <module>lcxm-cas-sso-server</module>
    </modules>

    <properties>
        <spring.boot.version>2.7.3</spring.boot.version>
        <!--maven-resources-plugin   使用@xx@ 占位符替代 ${xx} 占位符 -->
        <resource.delimiter>@</resource.delimiter>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <lcxm-common.version>1.0.1-2024</lcxm-common.version>
        <javax.servlet.version>4.0.0</javax.servlet.version>
        <spring-session-data-redis.version>2.7.3</spring-session-data-redis.version>
        <shiro-spring.version>1.8.0</shiro-spring.version>

        <!--system properties ↓ ↓ ↓-->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <project.encoding>UTF-8</project.encoding>
        <!--system properties ↑ ↑ ↑-->
        <!--maven plugin version ↓ ↓ ↓ -->
        <maven-compiler-plugin.version>3.9.0</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>

        <maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
        <!-- 此版本被spring-boot使用 当前2.6.7 中定义的为3.2.2 -->
        <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
        <!-- 打包时把源码打到本地 -->
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <!-- copy resources 3.2.0 报错  Input length = 1 -->
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <!-- spring boot  跟springboot版本走-->
        <!--<spring-boot-maven-plugin.version>2.7.2</spring-boot-maven-plugin.version>-->

        <spotbugs-maven-plugin.version>4.7.3.0</spotbugs-maven-plugin.version>
        <spotbugs.version>4.7.3</spotbugs.version>
        <!--maven plugin version ↑ ↑ ↑-->

        <!-- skip for  plugin  start ↓ ↓ ↓ -->
        <skip.spotbugs>false</skip.spotbugs>
        <!-- skip for  plugin  end   ↑ ↑ ↑ -->

    </properties>

    <!-- sonatype: 开源许可证声明 有很多不同的开源许可证 Apache Version2.0 表示别人可以直接商用你的开源项目而无任何版权问题 -->
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <!-- sonatype:开源地址 -->
    <scm>
        <connection>scm:git:ssh://git@gitee.com:basic-support/lcxm-cas-sso.git</connection>
        <developerConnection>scm:git:https://gitee.com/basic-support/lcxm-cas-sso.git</developerConnection>
        <url>https://gitee.com/basic-support/lcxm-cas-sso</url>
        <tag>HEAD</tag>
    </scm>

    <!--sonatype: Issue地址 -->
    <issueManagement>
        <system>git Issue</system>
        <url>https://gitee.com/basic-support/lcxm-cas-sso/issues</url>
    </issueManagement>

    <!--sonatype: 开发者信息 -->
    <developers>
        <developer>
            <name>vic.xu</name>
            <email>xuduochoua@163.com</email>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <!--版本控制-->
    <dependencyManagement>
        <dependencies>
            <!-- SpringBoot依赖 -->
            <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>

        <dependency>
            <groupId>cn.xuqiudong.basic</groupId>
            <artifactId>lcxm-common</artifactId>
            <version>${lcxm-common.version}</version>
        </dependency>
        <!-- 引入spring session, 不传递此依赖， 客户端根据情况决定是否引入 -->
        <!--https://docs.spring.io/spring-session/reference/guides/boot-redis.html -->
        <dependency>
            <groupId>org.springframework.session</groupId>
            <artifactId>spring-session-data-redis</artifactId>
            <version>${spring-session-data-redis.version}</version>
            <optional>true</optional>
        </dependency>

        <!-- 引入spring session, 不传递此依赖， 客户端根据情况决定是否引入 -->
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-spring</artifactId>
            <version>${shiro-spring.version}</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>

        <plugins>

            <!-- 指定jdk和编码 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.encoding}</encoding>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <!-- 跳过测试 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <skipTests>true</skipTests>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>

            <!--打包时 把源码打包到本地 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- copy resources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
            </plugin>

            <!--打jar插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>bundle-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <!--不进行doclint 检测-->
                            <doclint>none</doclint>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <source>${java.version}</source>
                    <maxmemory>1024</maxmemory>
                    <encoding>UTF-8</encoding>
                    <show>protected</show>
                    <notree>true</notree>

                    <!-- Avoid running into Java 8's very restrictive doclint issues -->
                    <failOnError>true</failOnError>
                    <!-- 防止文档不规范报错 -->
                    <!--<additionalparam>-Xdoclint:none</additionalparam>-->
                    <!--<additionalJOption>-Xdoclint:none</additionalJOption>-->
                    <!-- 自定义tag https://maven.apache.org/plugins/maven-javadoc-plugin/examples/tag-configuration.html-->
                    <tags>
                        <tag>
                            <name>description</name>
                            <!-- description tag for all places -->
                            <placement>a</placement>
                            <head>description about class or method and so on</head>
                        </tag>
                        <tag>
                            <name>date</name>
                            <!-- date tag for all places -->
                            <placement>a</placement>
                            <head>create date:</head>
                        </tag>
                    </tags>

                </configuration>
            </plugin>


            <!--spotbugs 静态bug检测：https://spotbugs.readthedocs.io/en/stable/maven.html  -->
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${spotbugs-maven-plugin.version}</version>
                <dependencies>
                    <!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
                    <dependency>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs</artifactId>
                        <version>${spotbugs.version}</version>
                    </dependency>
                    <!-- 引入注解(如)https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-annotations -->
                    <dependency>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-annotations</artifactId>
                        <version>${spotbugs.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>check</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!--参见：所有 detector https://spotbugs.readthedocs.io/en/stable/detectors.html -->
                    <!-- FindNullDeref : It is a slow detector.-->
                    <omitVisitors>UnreadFields,FindReturnRef,FindNullDeref</omitVisitors>
                    <skip>${skip.spotbugs}</skip>
                </configuration>
            </plugin>


        </plugins>

    </build>

    <profiles>
        <profile>
            <!-- 上传的时候使用的配置和插件 -Pdeploy-->
            <id>deploy</id>
            <build>
                <plugins>
                    <!-- https://central.sonatype.org/publish/publish-portal-maven/ -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.4.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <tokenAuth>true</tokenAuth>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>

                    <!--  生成签名，确定使用那个gpg秘钥 -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>

                                    <!--本地生成了对个秘钥对，所以这里指定一个发布成功的秘钥  gpg -k-->
                                    <keyname>877B1FAE177412DFA451E73B6CF967DE5C1F7A9E</keyname>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>