<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>mbap</groupId>
        <artifactId>mbap-parent</artifactId>
        <version>2.7.8</version>
    </parent>
    <groupId>mbap</groupId>
    <artifactId>mbap-auth</artifactId>
    <version>${versionId}</version>
<!--    <version>1.0</version>-->
    <name>mbap-auth</name>
    <description>mbap-auth</description>
    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <nexus.server.id>nexus-release</nexus.server.id>
        <nexus.server.ip>192.168.100.27:3691</nexus.server.ip>
        <nexus.release.url>http://${nexus.server.ip}/nexus/content/repositories/mbap</nexus.release.url>
        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
    </properties>
    <dependencies>
        <dependency>
            <groupId>mbap</groupId>
            <artifactId>mbap-core</artifactId>
            <version>r54.V20230317123931</version>
        </dependency>
        <dependency>
		   <groupId>org.springframework.cloud</groupId>
		   <artifactId>spring-cloud-starter-bootstrap</artifactId>
		   <version>3.1.5</version>
		</dependency>
<!--        &lt;!&ndash;必备: 注册中心客户端 &ndash;&gt;-->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        </dependency>
<!--        &lt;!&ndash;必备: 配置中心客户端 &ndash;&gt;-->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>
        <!--鉴权 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-authorization-server</artifactId>
            <version>0.4.0</version>
            <!--			<version>1.0.0</version>-->
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.13.4.2</version>
        </dependency>
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>5.5.6</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>

        <!--redis序列化相关 -->
        <dependency>
            <groupId>com.esotericsoftware</groupId>
            <artifactId>kryo</artifactId>
            <version>5.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.xerial.snappy</groupId>
            <artifactId>snappy-java</artifactId>
            <version>1.1.8.4</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.7</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.10</version>
        </dependency>
        <!-- dubbo 相关 -->
        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-spring-boot-starter</artifactId>
            <version>3.1.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-configcenter-nacos</artifactId>
            <version>3.1.6</version>
        </dependency>

        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-registry-nacos</artifactId>
            <version>3.1.6</version>
        </dependency>

        <!-- Spring Boot -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>${spring-boot.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <!-- Dubbo -->
        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-bom</artifactId>
            <version>3.1.6</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>mbap-gateway</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!--			 sonar扫描配置 -->
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>3.4.0.905</version>
            </plugin>
        </plugins>
    </build>
    <scm>
        <connection>scm:svn:svn://192.168.100.27/mbap-auth/branch</connection>
    </scm>
    <profiles>
        <!-- r2 parent,r2repo,r2zip都依赖 -->
        <profile>
            <activation>
                <property>
                    <name>r2parent</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <!--suppress UnresolvedMavenProperty -->
                <versionId>r${svn.revision}.V${timestamp}</versionId>
            </properties>
            <build>
                <plugins>
                    <!-- Use the svn revision number for the built artifact -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>buildnumber-maven-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>create</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <buildNumberPropertyName>svn.revision</buildNumberPropertyName>
                            <doCheck>false</doCheck>
                            <doUpdate>true</doUpdate>
                            <providerImplementations>
                                <svn>javasvn</svn>
                            </providerImplementations>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
                                <artifactId>maven-scm-provider-svnjava</artifactId>
                                <version>2.1.2</version>
                                <exclusions>
                                    <exclusion>
                                        <groupId>org.tmatesoft.svnkit</groupId>
                                        <artifactId>svnkit</artifactId>
                                    </exclusion>
                                </exclusions>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.8</version>
                        <executions>
                            <execution>
                                <id>default-cli</id>
                                <phase>package</phase>
                                <configuration>
                                    <target>
                                        <property name="compile_classpath"
                                                  refid="maven.compile.classpath"/>
                                        <property name="project.build.sourceDirectory"
                                                  value="${project.build.sourceDirectory}"/>
                                        <property name="project.build.directory"
                                                  value="${project.build.directory}"/>
                                        <property name="project.build.outputDirectory"
                                                  value="${project.build.outputDirectory}"/>
                                        <property name="project.build.finalName"
                                                  value="${project.build.finalName}"/>
                                        <property name="project.artifactId"
                                                  value="${project.artifactId}"/>
                                        <!--suppress UnresolvedMavenProperty -->
                                        <property name="svn.revision" value="${svn.revision}"/>
                                        <property name="timestamp" value="${timestamp}"/>
                                        <ant antfile="${ant.build}.xml"/>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- release to local repositories   本地打包命令 -->
        <profile>
            <id>r2repo</id>
            <properties>
                <ant.build>build_obf</ant.build>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-install-plugin</artifactId>
                        <version>2.5.2</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <version>${project.version}</version>
                                    <packaging>jar</packaging>
                                    <pomFile>${project.basedir}/pom.xml</pomFile>
                                    <file>${project.build.directory}/${project.build.finalName}.jar</file>
                                    <javadoc>${project.build.directory}/${project.build.finalName}-javadoc.jar</javadoc>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- release to nexus repositories 打包并提交到nexus私服仓库-->
        <profile>
            <id>r2nexus</id>
            <properties>
                <ant.build>build_r2nexus</ant.build>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>2.8.2</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>deploy-file</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <repositoryId>${nexus.server.id}</repositoryId>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <version>${project.version}</version>
                                    <packaging>jar</packaging>
                                    <pomFile>${project.basedir}/pom.xml</pomFile>
                                    <file>${project.build.directory}/${project.build.finalName}.jar</file>
                                    <javadoc>${project.build.directory}/${project.build.finalName}-javadoc.jar</javadoc>
                                    <url>${nexus.release.url}</url>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
