<?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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.5.5</version>
    </parent>
    <groupId>com.df4j</groupId>
    <artifactId>df4j-parent</artifactId>
    <version>1.0.2</version>
    <packaging>pom</packaging>
    <name>df4j-parent</name>
    <description>df4j-parent</description>
    <inceptionYear>2021</inceptionYear>

    <licenses>
        <license>
            <name>The MIT License (MIT)</name>
            <url>https://github.com/bestwxc/df4j-parent/blob/master/LICENSE</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Xuecheng Wang</name>
            <email>wxc252@hotmail.com</email>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/bestwxc/df4j-parent</url>
        <connection>scm:git:git@github.com:bestwxc/df4j-parent.git</connection>
        <developerConnection>scm:git:git@github.com:bestwxc/df4j-parent.git</developerConnection>
        <tag>V1.0.2</tag>
    </scm>

    <modules>
        <module>df4j-xcwork</module>
        <module>df4j-xcweb</module>
    </modules>

    <properties>
        <!-- maven plugin -->
        <maven-scm-plugin.version>1.12.0</maven-scm-plugin.version>
        <maven-release-plugin.version>3.0.0-M4</maven-release-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
        <maven-plugin-plugin.version>3.6.1</maven-plugin-plugin.version>
        <git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>

        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>

        <maven.javadoc.encoding>UTF-8</maven.javadoc.encoding>
        <maven.javadoc.charset>UTF-8</maven.javadoc.charset>
        <maven.javadoc.docencoding>UTF-8</maven.javadoc.docencoding>

        <!--自定义打包配置-->
        <spring-boot.mainClass>com.df4j.xcwork.Application</spring-boot.mainClass>
        <assembly.config.file>package.xml</assembly.config.file>
        <git.properties.filepath>${project.artifactId}-git.properties</git.properties.filepath>

        <spring-cloud.version>2020.0.4</spring-cloud.version>

        <!-- mybatis -->
        <mybatis-spring-boot-starter.version>2.2.0</mybatis-spring-boot-starter.version>
        <mybatis-generator.version>1.3.7</mybatis-generator.version>
        <pagehelper-spring-boot-starter.version>1.3.1</pagehelper-spring-boot-starter.version>
        <mapper.version>4.1.5</mapper.version>

        <!-- 工作流flowable -->
        <flowable.version>6.6.0</flowable.version>

        <!-- 数据库驱动 -->
        <mysql-connector-java.version>8.0.25</mysql-connector-java.version>

        <c3p0.version>0.9.5.5</c3p0.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>

            <!--spring cloud-->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.flowable</groupId>
                <artifactId>flowable-engine</artifactId>
                <version>${flowable.version}</version>
            </dependency>

            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>${mysql-connector-java.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mybatis.spring.boot</groupId>
                <artifactId>mybatis-spring-boot-starter</artifactId>
                <version>${mybatis-spring-boot-starter.version}</version>
            </dependency>

            <dependency>
                <groupId>com.github.pagehelper</groupId>
                <artifactId>pagehelper-spring-boot-starter</artifactId>
                <version>${pagehelper-spring-boot-starter.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.mybatis.spring.boot</groupId>
                        <artifactId>mybatis-spring-boot-starter</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>tk.mybatis</groupId>
                <artifactId>mapper</artifactId>
                <version>${mapper.version}</version>
            </dependency>

            <!-- 数据库相关 -->
            <dependency>
                <groupId>com.mchange</groupId>
                <artifactId>c3p0</artifactId>
                <version>${c3p0.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-plugin</artifactId>
                    <version>${maven-scm-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <tagNameFormat>V${project.version}</tagNameFormat>
                        <!--因为是聚合工程，设置这个参数免去为每个子模块设置版本号的动作，统一使用聚合模块的版本号-->
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <!--禁用超级pom中的profile文件-->
                        <useReleaseProfile>false</useReleaseProfile>
                        <!--使用自定的profile文件-->
                        <releaseProfiles>deploy,dev</releaseProfiles>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven-plugin-plugin.version}</version>
                </plugin>
                <!--编译插件-->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <encoding>${maven.compiler.encoding}</encoding>
                    </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>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!--springboot 插件-->
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <mainClass>${spring-boot.mainClass}</mainClass>
                        <fork>true</fork>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.mybatis.generator</groupId>
                    <artifactId>mybatis-generator-maven-plugin</artifactId>
                    <version>${mybatis-generator.version}</version>
                    <configuration>
                        <configurationFile>${basedir}/dev/generator/generatorConfig.xml</configurationFile>
                        <overwrite>true</overwrite>
                        <verbose>true</verbose>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>mysql</groupId>
                            <artifactId>mysql-connector-java</artifactId>
                            <version>${mysql.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>tk.mybatis</groupId>
                            <artifactId>mapper-generator</artifactId>
                            <version>${mapper.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <!--自定义打包装配插件-->
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                    <configuration>
                        <!-- not append assembly id in release file name -->
                        <appendAssemblyId>false</appendAssemblyId>
                        <descriptors>
                            <descriptor>${assembly.config.file}</descriptor>
                        </descriptors>
                    </configuration>
                    <executions>
                        <execution>
                            <id>make-assembly</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!--javadoc插件-->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <encoding>${maven.javadoc.encoding}</encoding>
                        <charset>${maven.javadoc.charset}</charset>
                        <docencoding>${maven.javadoc.docencoding}</docencoding>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!--gpg 插件-->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <version>${git-commit-id-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>revision</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <verbose>true</verbose>
                        <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
                        <generateGitPropertiesFile>true</generateGitPropertiesFile>
                        <generateGitPropertiesFilename>${project.build.outputDirectory}/${git.properties.filepath}</generateGitPropertiesFilename>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <!-- 发布用中央仓库配置 -->
    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>dev</id>
            <repositories>
                <repository>
                    <id>oss-snapshots</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>spring-snapshots</id>
                    <url>https://repo.spring.io/snapshot</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>spring-milestones</id>
                    <url>https://repo.spring.io/milestone</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>oss-snapshots</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>spring-snapshots</id>
                    <url>https://repo.spring.io/snapshot</url>
                </pluginRepository>
                <pluginRepository>
                    <id>spring-milestones</id>
                    <url>https://repo.spring.io/milestone</url>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>