<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
  ~
  ~ 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: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.yifu.cloud.plus.v1</groupId>
	<artifactId>yifu</artifactId>
	<name>${project.artifactId}</name>
	<version>1.0.0</version>
	<packaging>pom</packaging>
	<properties>
		<spring-boot.version>2.6.7</spring-boot.version>
		<spring-cloud.version>2021.0.2</spring-cloud.version>
		<spring-cloud-alibaba.version>2021.0.1.0</spring-cloud-alibaba.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<spring-boot-admin.version>2.6.7</spring-boot-admin.version>
		<hutool.version>5.8.0</hutool.version>
		<dynamic-ds.version>3.5.1</dynamic-ds.version>
		<captcha.version>2.2.2</captcha.version>
		<velocity.version>2.3</velocity.version>
		<velocity.tool.version>3.1</velocity.tool.version>
		<configuration.version>1.10</configuration.version>
		<jasypt.version>2.1.0</jasypt.version>
		<swagger.fox.version>3.0.0</swagger.fox.version>
		<xxl-job.version>2.3.0</xxl-job.version>
		<docker.plugin.version>0.32.0</docker.plugin.version>
		<docker.host>http://192.168.0.100:2375</docker.host>
		<docker.registry>192.168.0.100</docker.registry>
		<docker.namespace>yifu4cloud</docker.namespace>
		<docker.username>username</docker.username>
		<docker.password>password</docker.password>
		<git.commit.plugin>4.9.9</git.commit.plugin>
		<spring.checkstyle.plugin>0.0.29</spring.checkstyle.plugin>
		<mail.version>1.4.7</mail.version>
	</properties>

	<!-- 以下依赖 全局所有的模块都会引入  -->
	<dependencies>
		<!--配置文件处理器-->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-configuration-processor</artifactId>
			<optional>true</optional>
		</dependency>
		<!--配置文件加解密-->
		<dependency>
			<groupId>com.github.ulisesbocchio</groupId>
			<artifactId>jasypt-spring-boot-starter</artifactId>
			<version>${jasypt.version}</version>
		</dependency>
		<!--监控-->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<!--监控客户端-->
		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-starter-client</artifactId>
			<version>${spring-boot-admin.version}</version>
		</dependency>
		<!--Lombok-->
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<scope>provided</scope>
		</dependency>
		<!--测试依赖-->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<!-- 发送邮件依赖 -->
		<dependency>
			<groupId>javax.mail</groupId>
			<artifactId>mail</artifactId>
			<version>${mail.version}</version>
		</dependency>
	</dependencies>

	<modules>
		<module>yifu-auth</module>
		<module>yifu-upms</module>
		<module>yifu-common</module>
		<module>yifu-visual</module>
        <module>yifu-job</module>
        <module>yifu-check</module>
		<module>yifu-archives</module>
		<module>yifu-social</module>
        <module>yifu-insurances</module>
		<module>yifu-salary</module>
        <module>yifu-order</module>
		<module>yifu-mail</module>
		<module>yifu-business</module>
		<module>yifu-msg</module>
		<module>yifu-permission</module>
		<module>yifu-ekp</module>
	</modules>

	<dependencyManagement>
		<dependencies>
			<!--yifu 公共版本定义-->
			<dependency>
				<groupId>com.yifu.cloud.plus.v1</groupId>
				<artifactId>yifu-common-bom</artifactId>
				<version>${project.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</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>
			<!-- 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>
			<!-- spring cloud alibaba 依赖 -->
			<dependency>
				<groupId>com.alibaba.cloud</groupId>
				<artifactId>spring-cloud-alibaba-dependencies</artifactId>
				<version>${spring-cloud-alibaba.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<finalName>${project.name}</finalName>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-maven-plugin</artifactId>
					<version>${spring-boot.version}</version>
					<configuration>
						<finalName>${project.build.finalName}</finalName>
						<layers>
							<enabled>true</enabled>
						</layers>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>repackage</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>io.fabric8</groupId>
					<artifactId>docker-maven-plugin</artifactId>
					<version>${docker.plugin.version}</version>
					<configuration>
						<!-- Docker Remote Api-->
						<dockerHost>${docker.host}</dockerHost>
						<!-- Docker 镜像私服-->
						<registry>${docker.registry}</registry>
						<!-- 认证信息-->
						<authConfig>
							<push>
								<username>${docker.username}</username>
								<password>${docker.password}</password>
							</push>
						</authConfig>
						<images>
							<image>
								<!-- 镜像名称: 172.17.0.111/library/yifu-gateway:2.6.3-->
								<name>${docker.registry}/${docker.namespace}/${project.name}:${project.version}</name>
								<build>
									<dockerFile>${project.basedir}/Dockerfile</dockerFile>
								</build>
							</image>
						</images>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<!--打包jar 与git commit 关联插件-->
			<plugin>
				<groupId>io.github.git-commit-id</groupId>
				<artifactId>git-commit-id-maven-plugin</artifactId>
				<version>${git.commit.plugin}</version>
				<executions>
					<execution>
						<id>get-the-git-infos</id>
						<goals>
							<goal>revision</goal>
						</goals>
						<phase>initialize</phase>
					</execution>
				</executions>
				<configuration>
					<failOnNoGitDirectory>false</failOnNoGitDirectory>
					<generateGitPropertiesFile>true</generateGitPropertiesFile>
					<!--因为项目定制了jackson的日期时间序列化/反序列化格式,因此这里要进行配置,不然通过management.info.git.mode=full进行完整git信息监控时会存在问题-->
					<dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
					<includeOnlyProperties>
						<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
						<includeOnlyProperty>^git.commit.(id|message|time).*$</includeOnlyProperty>
					</includeOnlyProperties>
				</configuration>
			</plugin>
			<!--代码格式插件,默认使用spring 规则-->
			<plugin>
				<groupId>io.spring.javaformat</groupId>
				<artifactId>spring-javaformat-maven-plugin</artifactId>
				<version>${spring.checkstyle.plugin}</version>
			</plugin>

			<plugin>
				<groupId>com.amashchenko.maven.plugin</groupId>
				<artifactId>gitflow-maven-plugin</artifactId>
				<version>1.11.0</version>
				<configuration>
					<!--详细打印日志-->
					<verbose>true</verbose>
					<!--maven安装项目到本地-->
					<installProject>false</installProject>
					<!--跳过maven测试-->
					<skipTestProject>true</skipTestProject>
					<!--推送远程服务器-->
					<pushRemote>true</pushRemote>
					<!--保留分支-->
					<keepBranch>true</keepBranch>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>dev</id>
			<activation>
				<!-- 默认环境 -->
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
				<!-- 环境标识,需要与配置文件的名称相对应 -->
				<profiles.active>dev</profiles.active>
				<!-- 天翼云-->
				<my.hub.host>hub.worfu.com</my.hub.host>
				<map.group.name>qas-mvp</map.group.name>
				<!--  众多参数配置 -->
			</properties>
		</profile>
		<profile>
			<id>prd</id>
			<properties>
				<!-- 环境标识,需要与配置文件的名称相对应 -->
				<profiles.active>prd</profiles.active>
				<!-- 天翼云-->
				<my.hub.host>hub.worfu.com</my.hub.host>
				<map.group.name>prd-mvp</map.group.name>
				<!--  众多参数配置 -->
			</properties>
		</profile>
		<profile>
			<id>test</id>

			<properties>
				<!-- 环境标识,需要与配置文件的名称相对应 -->
				<profiles.active>test</profiles.active>
				<!-- 天翼云-->
				<my.hub.host>hub.worfu.com</my.hub.host>
				<map.group.name>qas-mvp</map.group.name>
				<!--  众多参数配置 -->
			</properties>
		</profile>
	</profiles>
</project>