<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~    Copyright (c) 2021-2022.  lWoHvYe(Hongyan Wang)
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~    you may not use this file except in compliance with the License.
  ~    You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~    See the License for the specific language governing permissions and
  ~    limitations under the License.
  -->

<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>

    <groupId>com.lwohvye</groupId>
    <artifactId>eladmin</artifactId>
    <packaging>pom</packaging>
    <version>3.0.0</version>

    <name>EL-ADMIN 管理系统</name>
    <url>https://github.com/lWoHvYe/eladmin</url>
    <description>A Spring Boot Project With Jpa JWT Security and so on</description>

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

    <developers>
        <developer>
            <id>lWoHvYe</id>
            <name>王红岩 (lWoHvYe)</name>
            <email>lWoHvYe@outlook.com</email>
            <url>https://www.lwohvye.com</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/lWoHvYe/eladmin.git</connection>
        <developerConnection>scm:git:ssh://github.com/lWoHvYe/eladmin.git</developerConnection>
        <url>https://github.com/lWoHvYe/eladmin/tree/main</url>
        <tag>eladmin-v3.0.0</tag>
    </scm>

    <modules>
        <module>eladmin-common</module>
        <module>eladmin-api</module>
        <module>eladmin-logging</module>
        <module>eladmin-system</module>
        <module>eladmin-tools</module>
        <module>eladmin-generator</module>
    </modules>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.3</version>
        <!--<relativePath/>设定一个空值将始终从仓库中获取，不从本地路径获取。
        查找顺序：relativePath元素中的地址–本地仓库–远程仓库-->
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <!--    Spring Boot依赖版本配置：https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#dependency-versions.properties    -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>17</java.version>
        <project.core.version>3.0.0</project.core.version>
        <log4jdbc.version>1.16</log4jdbc.version>
        <springdoc.openapi.version>1.6.5</springdoc.openapi.version>
        <io.swagger.version>1.6.4</io.swagger.version>
        <druid.version>1.2.8</druid.version>
        <hutool.version>5.7.20</hutool.version>
        <fastutil.version>8.5.6</fastutil.version>
        <lombok.version>1.18.22</lombok.version>
        <commons-pool2.version>2.11.1</commons-pool2.version>
        <!--mapstruct也要用新版本才行-->
        <mapstruct.version>1.4.2.Final</mapstruct.version>
        <!--    指定版本，新版本Spring Boot发布后可移除    -->
        <!--        <log4j2.version>2.17.0</log4j2.version>-->
        <!--logstash有所依赖，需要使用management统一管理依赖-->
        <logstash.version>7.0.1</logstash.version>
        <!--  LDAP（Lightweight Directory Access Protocol轻量目录访问协议） logback也来了 https://logback.qos.ch/news.html     -->
        <logback.version>1.2.10</logback.version>
        <redisson.version>3.16.8</redisson.version>
        <guava.version>31.0.1-jre</guava.version>
        <poi.version>5.2.0</poi.version>
        <xerces.version>2.12.2</xerces.version>
        <yauaa.version>6.8</yauaa.version>
        <ip2region.version>2.6.3</ip2region.version>
        <thumbnailator.version>0.4.16</thumbnailator.version>
        <pdfbox.version>2.0.25</pdfbox.version>
        <xmlsec.version>2.3.0</xmlsec.version>
        <xmlgraphics.version>2.7</xmlgraphics.version>
        <batik.version>1.14</batik.version>
        <argLine>
            -Dfile.encoding=UTF-8
        </argLine>
    </properties>

    <dependencies>
        <!--Spring boot 核心-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <!--Spring boot Web容器-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-undertow</artifactId>
        </dependency>

        <!--Spring boot 测试-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!--Spring boot 安全框架-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <!-- spring boot 缓存 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>

        <!--Spring boot Redis-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <!-- Redisson -->
        <dependency>
            <groupId>org.redisson</groupId>
            <artifactId>redisson-spring-boot-starter</artifactId>
            <version>${redisson.version}</version>
        </dependency>

        <!--spring boot 集成redis所需common-pool2-->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <!--Annotation Processor-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <!--监控sql日志-->
        <dependency>
            <groupId>org.bgee.log4jdbc-log4j2</groupId>
            <artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
            <version>${log4jdbc.version}</version>
        </dependency>

        <!-- Swagger UI 相关 -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>${springdoc.openapi.version}</version>
        </dependency>
        <!--    his dependency helps ignoring @AuthenticationPrincipal in case its used on REST Controllers    -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-security</artifactId>
            <version>${springdoc.openapi.version}</version>
        </dependency>
        <!--    enable the support of spring Pageable Type    -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-data-rest</artifactId>
            <version>${springdoc.openapi.version}</version>
        </dependency>
        <!--   enable javadoc support     -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-javadoc</artifactId>
            <version>${springdoc.openapi.version}</version>
        </dependency>
        <!--    swagger-core依赖该包，部分原因，需单独升级依赖版本    -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
        <!--Mysql依赖包-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <!--scope元素主要用来控制依赖的使用范围，指定当前包的依赖范围和依赖的传递性，也就是哪些依赖在哪些classpath中可用。
            常见的可选值有：compile, provided, runtime, test, system等。-->
            <scope>runtime</scope>
        </dependency>

        <!-- druid数据源驱动 ; 注：使用shardingsphere时。这里不能用druid但spring-boot-starter -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>${druid.version}</version>
            <!--      不兼容Jdk 11 及以上版本，移除依赖 https://github.com/alibaba/druid/issues/3060      -->
            <exclusions>
                <exclusion>
                    <artifactId>jconsole</artifactId>
                    <groupId>com.sun</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>tools</artifactId>
                    <groupId>com.sun</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- ip2region IP库 -->
        <dependency>
            <groupId>net.dreamlu</groupId>
            <artifactId>mica-ip2region</artifactId>
            <version>${ip2region.version}</version>
        </dependency>

        <!--lombok插件-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <!--optional是Maven依赖jar时的一个选项，表示该依赖是可选的，项目之间依赖不传递。不设置optional（默认）或者optional是false，表示传递依赖。-->
            <optional>true</optional>
        </dependency>

        <!-- excel工具 -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>${poi.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${poi.version}</version>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>${xerces.version}</version>
        </dependency>

        <!--mapStruct依赖-->
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${mapstruct.version}</version>
            <scope>provided</scope>
        </dependency>
        <!--   具体可以看看这个，https://jcp.org/en/jsr/detail?id=330     -->
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>

        <!-- Java图形验证码。该项目闭源，后续找找替代方案 -->
        <dependency>
            <groupId>com.github.whvcse</groupId>
            <artifactId>easy-captcha</artifactId>
            <version>1.6.2</version>
        </dependency>

        <!-- 解析客户端操作系统、浏览器信息 -->
        <dependency>
            <groupId>nl.basjes.parse.useragent</groupId>
            <artifactId>yauaa</artifactId>
            <version>${yauaa.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>commons-collections4</artifactId>
                    <groupId>org.apache.commons</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- logstash -->
        <dependency>
            <groupId>net.logstash.logback</groupId>
            <artifactId>logstash-logback-encoder</artifactId>
            <version>${logstash.version}</version>
            <!-- Use runtime scope if the project does not have any compile-time usage of logstash-logback-encoder,
                such as usage of StructuredArguments/Markers or implementations such as
                JsonProvider, AppenderListener, JsonFactoryDecorator, JsonGeneratorDecorator, etc
            <scope>runtime</scope>
            -->
        </dependency>
        <!--图片处理。主要为调整图片的尺寸-->
        <dependency>
            <groupId>net.coobird</groupId>
            <artifactId>thumbnailator</artifactId>
            <version>${thumbnailator.version}</version>
        </dependency>
        <!--   fixed dependencies of plugins with threat    -->
        <!--   下面几个依赖的具体用途
        Apache XML Graphics Commons is a library that consists of several reusable components used by Apache Batik and Apache FOP.
        Many of these components can easily be used separately outside the domains of SVG and XSL-FO.
        You'll find components such as a PDF library, an RTF library, Graphics2D implementations that let you generate PDF and PostScript files and much more.     -->
        <!--   4pdfbox     -->
        <!-- https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox -->
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>${pdfbox.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>fontbox</artifactId>
            <version>${pdfbox.version}</version>
        </dependency>
        <!--    4xmlsec    -->
        <!-- https://mvnrepository.com/artifact/org.apache.santuario/xmlsec -->
        <dependency>
            <groupId>org.apache.santuario</groupId>
            <artifactId>xmlsec</artifactId>
            <version>${xmlsec.version}</version>
        </dependency>
        <!--    4xmlgraphics-commons    -->
        <dependency>
            <groupId>org.apache.xmlgraphics</groupId>
            <artifactId>xmlgraphics-commons</artifactId>
            <version>${xmlgraphics.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>commons-io</artifactId>
                    <groupId>commons-io</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-logging</artifactId>
                    <groupId>commons-logging</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--    4batik  Batik is a Java-based toolkit for applications or applets that want to use images in the Scalable Vector Graphics (SVG) format for various purposes, such as display, generation or manipulation.  -->
        <dependency>
            <groupId>org.apache.xmlgraphics</groupId>
            <artifactId>batik-all</artifactId>
            <version>${batik.version}</version>
        </dependency>
    </dependencies>
    <!--
        If you are using logstash-logback-encoder in a project (such as spring-boot) that also declares dependencies on any of the above libraries,
    you might need to tell maven explicitly which versions to use to avoid conflicts. You can do so using maven's dependencyManagement feature.
    For example, to ensure that maven doesn't pick different versions of logback-core, logback-classic, and logback-access, add this to your project's pom.xml
    -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-access</artifactId>
                <version>${logback.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <!-- 打包时跳过测试 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <!-- 解决 Java-16下 lombok报错：
            Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x486bcaa) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x486bcaa
            -->
            <plugin>
                <!-- maven-compiler-plugin应该是默认使用的。所以可以不显示的配置。 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                    <!--<release>16</release>-->
                    <!--<fork>true</fork>-->
                    <!--for unmappable characters in classes-->
                    <!-- <encoding>UTF-8</encoding>-->
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <!--for lombok annotations to resolve-->
                    <!--contradictory to maven, intelliJ fails with this-->
                    <annotationProcessorPaths>
                        <!--4lombok-->
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <!-- Support for Java 16
                            https://github.com/rzwitserloot/lombok/issues/2681#
                            -->
                            <version>${lombok.version}</version>
                        </path>
                        <!--4mapstruct-->
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                        <!--4javadoc-->
                        <path>
                            <groupId>com.github.therapi</groupId>
                            <artifactId>therapi-runtime-javadoc-scribe</artifactId>
                            <version>0.12.0</version>
                        </path>
                    </annotationProcessorPaths>
                    <!--https://docs.spring.io/spring-boot/docs/2.4.4/reference/html/appendix-configuration-metadata.html#configuration-metadata-annotation-processor-->
                    <!--<proc>none</proc>-->
                </configuration>
            </plugin>
            <!--自动发布插件-->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <!--For maven package error:  javadoc command: The environment variable JAVA_HOME is not correctly set.-->
                <configuration>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <!-- java8版本导致javadoc打包编译失败时候,maven-javadoc-plugin大于3.0.0添加-->
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-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>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <!--     https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html
                     https://www.lwohvye.com/2021/12/10/osgi-%e7%90%86%e8%a7%a3/
                     暂无打bundle-package的打算。留档
               -->
            <!--<plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>-->
            <!--     Maven JDK9 Jigsaw       -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jmod-plugin</artifactId>
                <version>3.0.0-alpha-1</version>
                <extensions>true</extensions>
            </plugin>
            <!--     Toolchains are ignored, 'javadocExecutable' parameter is set to。这个插件是用来配置maven run的jdk的，当前是通过其他方式配置了     -->
            <!--<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-toolchains-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <?m2e ignore ?>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <toolchains>
                        <jdk>
                            <version>17</version>
                            <vendor>oracle</vendor>
                        </jdk>
                    </toolchains>
                </configuration>
            </plugin>-->
        </plugins>
    </build>

    <distributionManagement>
        <!--        <repository>-->
        <!--            <id>github</id>-->
        <!--            <name>GitHub OWNER Apache Maven Packages</name>-->
        <!--            <url>https://maven.pkg.github.com/lWoHvYe/eladmin</url>-->
        <!--        </repository>-->
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
