<?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>
	<packaging>jar</packaging>
	<parent>
		<groupId>com.kakarote</groupId>
		<artifactId>wkcrm</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>

	<artifactId>wk_hrm</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>hrm</name>
	<description>系统管理</description>

	<dependencies>
		<dependency>
			<groupId>com.kakarote</groupId>
			<artifactId>core</artifactId>
			<version>${core.version}</version>
		</dependency>
		<dependency>
			<groupId>io.seata</groupId>
			<artifactId>seata-spring-boot-starter</artifactId>
		</dependency>
	</dependencies>

	<build>
		<resources>
			<resource>
				<!-- xml放在java目录下-->
				<directory>src/main/java/com/kakarote/${name}/</directory>
				<includes>
					<include>**/*.xml</include>
				</includes>
			</resource>
			<!--解决idea不识别resources的问题-->
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>

			<!--打包jar-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<!--MANIFEST.MF 中 Class-Path 加入前缀-->
							<classpathPrefix>lib/</classpathPrefix>
							<!--jar包不包含唯一版本标识-->
							<useUniqueVersions>false</useUniqueVersions>
							<!--指定入口类-->
							<mainClass>com.kakarote.hrm.HrmApplication</mainClass>
						</manifest>
						<manifestEntries>
							<!--MANIFEST.MF 中 Class-Path 加入资源文件目录-->
							<Class-Path>./config/</Class-Path>
						</manifestEntries>
					</archive>
					<outputDirectory>${project.build.directory}</outputDirectory>
				</configuration>
			</plugin>

			<!--拷贝依赖 copy-dependencies-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>
								${project.build.directory}/lib/
							</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!--拷贝资源文件 copy-resources-->
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
					<nonFilteredFileExtensions>
						<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
					</nonFilteredFileExtensions>
				</configuration>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>package</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>src/main/resources/</directory>
								</resource>
							</resources>
							<outputDirectory>${project.build.directory}/config</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<finalName>${name}</finalName>
					<appendAssemblyId>false</appendAssemblyId>
					<descriptors>
						<descriptor>../assembly.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>
