<?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>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>3.0.3</version>
		<relativePath />
	</parent>

	<groupId>com.acgist</groupId>
	<artifactId>taoyao</artifactId>
	<version>1.0.0</version>
	<packaging>pom</packaging>

	<url>https://gitee.com/acgist/taoyao</url>
	<name>taoyao</name>
	<description>桃夭：桃夭是套基于`Mediasoup`开发的`WebRTC`音视频信令服务</description>
	<inceptionYear>2022</inceptionYear>

	<properties>
		<!-- 版本 -->
		<java.version>17</java.version>
		<lombok.version>1.18.26</lombok.version>
		<springdoc.version>2.0.2</springdoc.version>
		<mapstruct.version>1.5.2.Final</mapstruct.version>
		<!-- 配置 -->
		<taoyao.maven.basedir>${project.basedir}</taoyao.maven.basedir>
		<taoyao.maven.encoding>UTF-8</taoyao.maven.encoding>
		<taoyao.maven.skip.assembly>true</taoyao.maven.skip.assembly>
	</properties>

	<modules>
		<module>taoyao-boot</module>
		<module>taoyao-signal</module>
		<module>taoyao-server</module>
	</modules>

	<dependencies>
		<!-- 快速开发 -->
		<dependency>
			<groupId>org.mapstruct</groupId>
			<artifactId>mapstruct</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mapstruct</groupId>
			<artifactId>mapstruct-processor</artifactId>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
		</dependency>
		<!-- 开发工具 -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<!-- Jackson -->
		<dependency>
			<groupId>com.fasterxml.jackson.datatype</groupId>
			<artifactId>jackson-datatype-jsr310</artifactId>
		</dependency>
		<!-- 接口文档 -->
		<dependency>
			<groupId>org.springdoc</groupId>
			<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
		</dependency>
		<!-- AOP -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-aop</artifactId>
		</dependency>
		<!-- 日志框架 -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-logging</artifactId>
		</dependency>
		
		<!-- 单元测试 -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.acgist</groupId>
				<artifactId>taoyao-boot</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>com.acgist</groupId>
				<artifactId>taoyao-signal</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>com.acgist</groupId>
				<artifactId>taoyao-server</artifactId>
				<version>${project.version}</version>
			</dependency>
			<!-- mapstruct -->
			<dependency>
				<groupId>org.mapstruct</groupId>
				<artifactId>mapstruct</artifactId>
				<version>${mapstruct.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.mapstruct</groupId>
				<artifactId>mapstruct-processor</artifactId>
				<version>${mapstruct.version}</version>
				<scope>provided</scope>
			</dependency>
			<!-- lombok -->
			<dependency>
				<groupId>org.projectlombok</groupId>
				<artifactId>lombok</artifactId>
				<version>${lombok.version}</version>
				<scope>provided</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<include>**/*.yml</include>
					<include>**/*.properties</include>
				</includes>
				<filtering>true</filtering>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<!-- 匹配所有文件：**/* -->
					<!-- 匹配所有带有后缀文件：**/*.* -->
					<include>**/*.*</include>
				</includes>
				<excludes>
					<exclude>**/*.yml</exclude>
					<exclude>**/*.properties</exclude>
				</excludes>
				<filtering>false</filtering>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>${java.version}</source>
						<target>${java.version}</target>
						<encoding>${taoyao.maven.encoding}</encoding>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<configuration>
						<!-- Jar配置独立config目录 -->
						<excludes>
                            <include>*.jks</include>
                            <include>*.p12</include>
                            <include>*.pfx</include>
							<exclude>*.yml</exclude>
							<exclude>*.properties</exclude>
						</excludes>
						<archive>
							<manifestEntries>
								<!-- 配置文件 -->
								<Class-Path>../config/</Class-Path>
							</manifestEntries>
						</archive>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<executions>
						<execution>
							<id>assembly</id>
							<phase>package</phase>
							<goals>
								<goal>single</goal>
							</goals>
							<configuration>
								<attach>false</attach>
								<skipAssembly>${taoyao.maven.skip.assembly}</skipAssembly>
								<appendAssemblyId>false</appendAssemblyId>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>dev</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
				<profile>dev</profile>
				<taoyao.maven.jvm.arg></taoyao.maven.jvm.arg>
				<taoyao.maven.jvm.mem>-Xms512M -Xmx1024M -XX:NewRatio=1 -XX:SurvivorRatio=2</taoyao.maven.jvm.mem>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-assembly-plugin</artifactId>
						<configuration>
							<descriptors>
								<descriptor>${taoyao.maven.basedir}/docs/assembly/dev.xml</descriptor>
							</descriptors>
						</configuration>
					</plugin>
				</plugins>
			</build>
			<dependencyManagement>
				<dependencies>
					<dependency>
						<groupId>org.springdoc</groupId>
						<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
						<version>${springdoc.version}</version>
					</dependency>
				</dependencies>
			</dependencyManagement>
		</profile>
		<profile>
			<id>prd</id>
			<properties>
				<profile>prd</profile>
				<taoyao.maven.jvm.arg></taoyao.maven.jvm.arg>
				<taoyao.maven.jvm.mem>-Xms2048M -Xmx4096M -XX:NewRatio=1 -XX:SurvivorRatio=2</taoyao.maven.jvm.mem>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-assembly-plugin</artifactId>
						<configuration>
							<descriptors>
								<descriptor>${taoyao.maven.basedir}/docs/assembly/prd.xml</descriptor>
							</descriptors>
						</configuration>
					</plugin>
				</plugins>
			</build>
			<dependencyManagement>
				<dependencies>
					<dependency>
						<groupId>org.springdoc</groupId>
						<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
						<version>${springdoc.version}</version>
						<scope>provided</scope>
					</dependency>
				</dependencies>
			</dependencyManagement>
		</profile>
	</profiles>

</project>