<?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>abacus.framework</groupId>
		<artifactId>abacus.springcloud.pom</artifactId>
		<version>1.5.0</version>
	</parent>

	<artifactId>abacus.springboot.example</artifactId>
	<version>1.0.0</version>

	<name>abacus.springboot.example</name>
	<dependencies>
		<!-- config-配置相关文件 -->
		<dependency>
			<groupId>abacus</groupId>
			<artifactId>abacus.config</artifactId>
			<version>2.1.0</version>
			<exclusions>
				<exclusion>
					<groupId>org.bouncycastle</groupId>
					<artifactId>bcprov-ext-jdk15</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		
		<!-- 通用服务 -->
		<dependency>
			<groupId>abacus.framework</groupId>
		    <artifactId>abacus.commons</artifactId>
		    <version>1.6.5</version>
		</dependency>
		
		<!-- alibaba-fastjson -->
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.83</version>
		</dependency>
		
		<!-- 各数据库相关驱动 -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.jtds</groupId>
			<artifactId>jtds</artifactId>
		</dependency>
		<dependency>
		    <groupId>com.microsoft.sqlserver</groupId>
		    <artifactId>mssql-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>oracle</groupId>
			<artifactId>oracle-jdbc</artifactId>
			<version>11.2.0.3.0</version>
		</dependency>
		<dependency>
			<groupId>com.xuxueli</groupId>
			<artifactId>xxl-job-core</artifactId>
			<version>2.3.0</version>
		</dependency>
		
		<!-- http -->
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-httpclient</groupId>
			<artifactId>commons-httpclient</artifactId>
			<version>3.1</version>
		</dependency>
		<dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>4.5</version>
        </dependency>
		
		<dependency>
			<groupId>abacus.framework</groupId>
			<artifactId>abacus.asyncTool</artifactId>
			<version>1.0.0</version>
		</dependency>
		
		<!-- abacus-fundation-基础包 -->
		<dependency>
			<groupId>abacus</groupId>
  			<artifactId>abacus.fundation</artifactId>
 			<version>3.4.4</version>
		</dependency>
		
		<!-- pms-商品基础资料服务 -->
		<dependency>
			<groupId>abacus.org.pms</groupId>
			<artifactId>abacus.org.pms.service</artifactId>
			<version>4.3.1</version>
		</dependency>
		
		<dependency>
            <groupId>com.dameng</groupId>
            <artifactId>DmJdbcDriver18</artifactId>
            <version>8.1.3.140</version>
        </dependency>
	</dependencies>
	<profiles>
	    <profile>
	        <id>dev</id>
	        <properties>
	            <profiles.active>dev</profiles.active>
	        </properties>
	        <activation>
	            <activeByDefault>true</activeByDefault>
	        </activation>
	    </profile>
	    <profile>
	        <id>test</id>
	        <properties>
	            <profiles.active>test</profiles.active>
	        </properties>
	    </profile>
	    <profile>
	        <id>prod</id>
	        <properties>
	            <profiles.active>prod</profiles.active>
	        </properties>
	    </profile>
	</profiles>
	<build>
		<resources>
			<resource>
				<directory>META-INF</directory>
				<targetPath>META-INF</targetPath>
			</resource>
	        <!-- 指定需要打入resources中的配置文件 -->
	        <resource>
	            <directory>src/main/resources/config/${profiles.active}</directory>
	        </resource>
			<resource>
	            <directory>src/main/resources</directory>
	            <includes>  
	                <include>sql/**</include>  
	            </includes>  
	        </resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
				  <includeSystemScope>true</includeSystemScope>
				</configuration>
				<executions>
			        <execution>
			            <goals>
			                <goal>build-info</goal>
			            </goals>
			        </execution>
			    </executions>
			</plugin>
			<!-- 发布包 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.5.4</version>
				<executions>
					<execution><!-- 配置执行器 -->
						<id>make-assembly</id>
						<phase>package</phase><!-- 绑定到package生命周期阶段上 -->
						<goals>
							<goal>single</goal><!-- 只运行一次 -->
						</goals>
						<configuration>
							<finalName>${project.artifactId}-${project.version}</finalName> 
							<descriptor>assembly.xml</descriptor><!--配置描述文件路径 -->
						</configuration>
					</execution>
				</executions>
			</plugin>
			
			
			 <!-- Spring Boot Maven Plugin：负责启动/停止应用 -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>2.5.6</version> <!-- 与您的项目版本一致 -->
            <configuration>
                <!-- 必须启用 admin 功能，否则 start/stop 可能不生效 -->
                <jvmArguments>-Dspring.application.admin.enabled=true</jvmArguments>
            </configuration>
            <executions>
                <execution>
                    <id>pre-integration-test</id>
                    <goals>
                        <goal>start</goal> <!-- 在集成测试前启动 -->
                    </goals>
                </execution>
                <execution>
                    <id>post-integration-test</id>
                    <goals>
                        <goal>stop</goal> <!-- 在集成测试后停止 -->
                    </goals>
                </execution>
            </executions>
        </plugin>

        <!-- springdoc-openapi-maven-plugin：生成 openapi.json -->
        <plugin>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-maven-plugin</artifactId>
            <version>1.5</version>
            <executions>
                <execution>
                    <id>integration-test</id>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <!-- 如果应用端口不是 8080，请在这里修改 -->
            <configuration>
                <apiDocsUrl>http://localhost:8080/v3/api-docs</apiDocsUrl>
                <outputFileName>openapi.json</outputFileName>
                <outputDir>${project.build.directory}</outputDir>
            </configuration>
        </plugin>
		</plugins>
	</build>

</project>
