<?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">
	<parent>
		<artifactId>huimv.farm.nongkeyuan</artifactId>
		<groupId>com.your.packages</groupId>
		<version>1.4.0</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>

	<artifactId>ballcat-codegen-backend</artifactId>
	<packaging>jar</packaging>

	<properties>
		<!-- 版本控制 -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<ojdbc8.version>21.5.0.0</ojdbc8.version>
		<velocity.version>1.7</velocity.version>
		<freemarker.version>2.3.31</freemarker.version>
		<flyway.version>7.15.0</flyway.version>
		<dynamic-datasource.version>3.6.1</dynamic-datasource.version>
		<jasypt.version>3.0.5</jasypt.version>
	</properties>

	<dependencies>
		<!--webmvc-->
		<dependency>
			<groupId>com.hccake</groupId>
			<artifactId>ballcat-spring-boot-starter-web</artifactId>
		</dependency>
		<!--mybatis plus-->
		<dependency>
			<groupId>com.hccake</groupId>
			<artifactId>ballcat-extend-mybatis-plus</artifactId>
		</dependency>
		<dependency>
			<groupId>com.baomidou</groupId>
			<artifactId>mybatis-plus-boot-starter</artifactId>
		</dependency>

		<!-- jasypt 加密 -->
		<dependency>
			<groupId>com.github.ulisesbocchio</groupId>
			<artifactId>jasypt-spring-boot-starter</artifactId>
			<version>${jasypt.version}</version>
		</dependency>

		<!-- openapi 扩展处理 -->
		<dependency>
			<groupId>com.hccake</groupId>
			<artifactId>ballcat-extend-openapi</artifactId>
		</dependency>
		<!-- springdoc swagger-ui -->
		<dependency>
			<groupId>org.springdoc</groupId>
			<artifactId>springdoc-openapi-ui</artifactId>
		</dependency>

		<!--动态数据源-->
		<dependency>
			<groupId>com.baomidou</groupId>
			<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
			<version>${dynamic-datasource.version}</version>
		</dependency>


		<!-- mysql 驱动 -->
		<dependency>
			<groupId>com.mysql</groupId>
			<artifactId>mysql-connector-j</artifactId>
		</dependency>
		<!-- postgresql 驱动 -->
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
		</dependency>
		<!-- sqlserver 驱动 -->
		<dependency>
			<groupId>com.microsoft.sqlserver</groupId>
			<artifactId>mssql-jdbc</artifactId>
		</dependency>
		<!-- oracle 驱动 -->
		<dependency>
			<groupId>com.oracle.database.jdbc</groupId>
			<artifactId>ojdbc8</artifactId>
			<version>${ojdbc8.version}</version>
		</dependency>


		<!--模板引擎-->
		<dependency>
			<artifactId>velocity</artifactId>
			<groupId>org.apache.velocity</groupId>
			<version>${velocity.version}</version>
		</dependency>
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<version>${freemarker.version}</version>
		</dependency>

		<!-- 数据库版本控制 -->
<!--		<dependency>-->
<!--			<groupId>org.flywaydb</groupId>-->
<!--			<artifactId>flyway-core</artifactId>-->
<!--			<version>${flyway.version}</version>-->
<!--		</dependency>-->
	</dependencies>

	<build>
		<finalName>ballcat-codegen</finalName>
		<resources>
			<resource>
				<filtering>true</filtering>
				<directory>src/main/resources</directory>
				<excludes>
					<exclude>static/report/**</exclude>
					<exclude>**/*.woff</exclude>
					<exclude>**/*.woff2</exclude>
					<exclude>**/*.ttf</exclude>
					<exclude>**/*.ico</exclude>
				</excludes>
			</resource>
			<resource>
				<filtering>false</filtering>
				<directory>src/main/resources</directory>
				<includes>
					<include>static/report/**</include>
					<include>**/*.woff</include>
					<include>**/*.woff2</include>
					<include>**/*.ttf</include>
					<include>**/*.ico</include>
				</includes>
			</resource>
			<!-- 扫描src/main/java下所有xx.xml文件 -->
			<resource>
				<filtering>false</filtering>
				<directory>src/main/java</directory>
				<includes>
					<include>**/*.xml</include>
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<phase>clean</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<delete dir="src/main/resources/public" includeemptydirs="true"/>
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<id>copy Vue.js frontend content</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>src/main/resources/public</outputDirectory>
							<overwrite>true</overwrite>
							<resources>
								<resource>
									<directory>${project.parent.basedir}/ballcat-codegen-frontend/target/dist
									</directory>
									<includes>
										<include>static/</include>
										<include>index.html</include>
										<include>favicon.ico</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<!-- 打包 docker，指定开启 docker profile -->
	<profiles>
		<profile>
			<id>docker</id>
			<build>
				<plugins>
					<!--   dockerfile-maven-plugin      -->
					<plugin>
						<groupId>com.spotify</groupId>
						<artifactId>dockerfile-maven-plugin</artifactId>
						<version>1.4.13</version>
						<executions>
							<execution>
								<id>default</id>
								<goals>
									<goal>build</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<repository>ballcat-codegen</repository>
							<tag>latest</tag>
							<buildArgs>
								<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
							</buildArgs>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>