<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>com.platomix</groupId>
		<artifactId>platomix-gmetry-xxljob</artifactId>
		<version>1.0.0</version>
	</parent>
	<artifactId>platomix-gmetry-xxljob-admin</artifactId>
	<packaging>jar</packaging>
	<version>1.0.3</version>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-parent</artifactId>
				<version>${spring-boot.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>com.kingbase8</groupId>
			<artifactId>kingbase8</artifactId>
			<version>8.6.0</version>
		</dependency>
		<!-- starter-web：spring-webmvc + autoconfigure + logback + yaml + tomcat -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<!-- starter-test：junit + spring-test + mockito -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- freemarker-starter -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-freemarker</artifactId>
		</dependency>

		<!-- mail-starter -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-mail</artifactId>
		</dependency>

		<!-- starter-actuator -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>

		<!-- mybatis-starter：mybatis + mybatis-spring + hikari（default） -->
		<dependency>
			<groupId>org.mybatis.spring.boot</groupId>
			<artifactId>mybatis-spring-boot-starter</artifactId>
			<version>${mybatis-spring-boot-starter.version}</version>
		</dependency>
		<!-- mysql -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>${mysql-connector-java.version}</version>
		</dependency>

		<!-- xxl-job-core -->
		<dependency>
			<groupId>com.platomix</groupId>
			<artifactId>platomix-gmetry-xxljob-core</artifactId>
			<version>${project.parent.version}</version>
		</dependency>

		<dependency>
			<groupId>com.alibaba.fastjson2</groupId>
			<artifactId>fastjson2</artifactId>
			<version>${fastjson2.version}</version>
		</dependency>
	</dependencies>
	
	<profiles>
		<profile>
			<id>arm</id>
			<properties>
				<cpu-architecture-classifier>-aarch64</cpu-architecture-classifier>
			</properties>
		</profile>
		<profile>
			<id>amd</id>
			<properties>
				<cpu-architecture-classifier></cpu-architecture-classifier>
			</properties>
			<activation>
                <activeByDefault>true</activeByDefault>
            </activation>
		</profile>
	</profiles>

	<build>
		<finalName>platomix-gmetry-xxljob</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>${spring-boot.version}</version>
				<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>
					<verbose>true</verbose>
					<images>
						<image>
							<name>${docker.registry}/${docker.namespace}/${project.build.finalName}:${project.version}${cpu-architecture-classifier}</name>
							<build>
								<contextDir>${project.basedir}</contextDir>
								<dockerFile>${project.basedir}/Dockerfile${cpu-architecture-classifier}</dockerFile>
								<args>
									<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
								</args>
							</build>
						</image>
					</images>
				</configuration>
				<executions>
					<execution>
						<id>build-push</id>
						<phase>package</phase>
						<goals>
							<goal>build</goal>
							<goal>push</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>
