<?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>
		<groupId>com.lc.ibps.provider</groupId>
		<artifactId>ibps-provider-root</artifactId>
		<version>4.0.1-LC.SAAS-RELEASE</version>
		<relativePath>../../pom.xml</relativePath>
	</parent>

	<modelVersion>4.0.0</modelVersion>
	<artifactId>ibps-provider-business</artifactId>

	<properties>
		<jboss-logging.version>3.3.0.Final</jboss-logging.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-discovery</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>de.ruedigermoeller</groupId>
					<artifactId>fst</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.mockito</groupId>
					<artifactId>mockito-junit-jupiter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.junit.jupiter</groupId>
					<artifactId>junit-jupiter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.jfirer</groupId>
					<artifactId>Fse</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.xerial.snappy</groupId>
					<artifactId>snappy-java</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.aventrix.jnanoid</groupId>
					<artifactId>jnanoid</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.protostuff</groupId>
					<artifactId>protostuff-core</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.protostuff</groupId>
					<artifactId>protostuff-runtime</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.bouncycastle</groupId>
					<artifactId>bcprov-jdk15to18</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.bouncycastle</groupId>
					<artifactId>bcprov-ext-jdk15to18</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-loadbalancer</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jboss.logging</groupId>
			<artifactId>jboss-logging</artifactId>
			<version>${jboss-logging.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
        	<artifactId>spring-boot-starter-log4j2</artifactId>
        	<exclusions>
        		<exclusion>
        			<groupId>org.slf4j</groupId>
        			<artifactId>jul-to-slf4j</artifactId>
        		</exclusion>
        	</exclusions>
		</dependency>
		
		<dependency>
			<groupId>com.lc.ibps.provider</groupId>
			<artifactId>ibps-provider-form</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>com.lc.ibps.cloud</groupId>
					<artifactId>ibps-basic-monitor</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.github.mweirauch</groupId>
					<artifactId>micrometer-jvm-extras</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.micrometer</groupId>
					<artifactId>
						micrometer-registry-prometheus
					</artifactId>
				</exclusion>
				<exclusion>
					<groupId>cn.hippo4j</groupId>
					<artifactId>hippo4j-spring-boot-starter</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.provider</groupId>
			<artifactId>ibps-provider-bpmn</artifactId>		
			<exclusions>
				<exclusion>
					<groupId>com.lc.ibps.provider.base</groupId>
					<artifactId>ibps-provider-form-client</artifactId>
				</exclusion>
				<!-- 应用瘦身 - start -->
				<exclusion>
					<groupId>com.lc.ibps.cloud</groupId>
					<artifactId>ibps-basic-monitor</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-dbcp</groupId>
					<artifactId>commons-dbcp</artifactId>
				</exclusion>
				<!-- 应用瘦身 - end -->
			</exclusions>	
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.appcenter</groupId>
			<artifactId>ibps-provider-appcenter</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>com.aventrix.jnanoid</groupId>
					<artifactId>jnanoid</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.micrometer</groupId>
					<artifactId>
						micrometer-registry-prometheus
					</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.github.mweirauch</groupId>
					<artifactId>micrometer-jvm-extras</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.provider.base</groupId>
			<artifactId>ibps-provider-platform-client</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud.base</groupId>
			<artifactId>ibps-comp-file-server-client</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud.base</groupId>
			<artifactId>ibps-comp-socket-client</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud.base</groupId>
			<artifactId>ibps-comp-message-server-client</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>org.springframework.kafka</groupId>
					<artifactId>spring-kafka</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.apache.kafka</groupId>
					<artifactId>kafka-streams</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		
		<dependency>
			<groupId>com.lc.ibps.message</groupId>
			<artifactId>ibps-message-consumer</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>de.ruedigermoeller</groupId>
					<artifactId>fst</artifactId>
				</exclusion>
				<exclusion>
					<groupId>redis.clients</groupId>
					<artifactId>jedis</artifactId>
				</exclusion>
				<exclusion>
					<groupId>cn.hippo4j</groupId>
					<artifactId>hippo4j-spring-boot-starter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.components</groupId>
					<artifactId>ibps-component-sms</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.message</groupId>
			<artifactId>ibps-message-producer</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.excessive</groupId>
			<artifactId>ibps-excessive-platform</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-oauth-client-feignclient</artifactId>
		</dependency>
		
		<!-- TODO 租户模式下添加该依赖 start -->
		<!-- 发布版本需要删除该依赖 -->
		<!--
		-->
		<dependency>
			<groupId>com.lc.ibps.saas</groupId>
			<artifactId>ibps-saas-base-db</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.saas</groupId>
			<artifactId>ibps-saas-base-feign</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.saas</groupId>
			<artifactId>ibps-provider-saas-client</artifactId>
		</dependency>
		<!-- TODO 租户模式下添加该依赖 end -->
		
		<dependency>
			<groupId>com.lc.ibps.components</groupId>
			<artifactId>ibps-component-cache</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>redis.clients</groupId>
					<artifactId>jedis</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		
        <dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-i18n</artifactId>
		</dependency> 

		<dependency>
		    <groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax</groupId>
			<artifactId>javaee-api</artifactId>
		</dependency>
		<dependency>
			<artifactId>xml-apis</artifactId>
			<groupId>xml-apis</groupId>
		</dependency>
		<dependency>
			<groupId>xerces</groupId>
			<artifactId>xercesImpl</artifactId>
			<exclusions>
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>jaxen</groupId>
			<artifactId>jaxen</artifactId>
		</dependency>
		
		<dependency>
			<groupId>net.sf.json-lib</groupId>
			<artifactId>json-lib</artifactId>
			<classifier>jdk15</classifier>
		</dependency>
		<!-- https://mvnrepository.com/artifact/net.sf.ezmorph/ezmorph -->
		<dependency>
			<groupId>net.sf.ezmorph</groupId>
			<artifactId>ezmorph</artifactId>
		</dependency>
		<!-- https://mvnrepository.com/artifact/net.sf.morph/morph -->
		<dependency>
			<groupId>net.sf.morph</groupId>
			<artifactId>morph</artifactId>
		</dependency>
		
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
		</dependency>
		<dependency>
			<groupId>com.oracle</groupId>
			<artifactId>oracledriver</artifactId>
		</dependency>
		<dependency>
		    <groupId>org.postgresql</groupId>
		    <artifactId>postgresql</artifactId>
		</dependency>
		<dependency>
			<groupId>dm.jdbc</groupId>
			<artifactId>DmJdbcDriver</artifactId>
			<classifier>1.8</classifier>
		</dependency>
		<dependency>
		    <groupId>com.microsoft.sqlserver</groupId>
		    <artifactId>mssql-jdbc</artifactId>
		    <scope>test</scope>
		</dependency>
		<dependency>
		    <groupId>kingbase</groupId>
		    <artifactId>kingbase8</artifactId>
		    <scope>test</scope>
		</dependency>
		<dependency>
		    <groupId>oscar</groupId>
		    <artifactId>oscar8</artifactId>
		    <scope>test</scope>
		</dependency>
		
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>org.mockito</groupId>
					<artifactId>mockito-junit-jupiter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.junit.jupiter</groupId>
					<artifactId>junit-jupiter</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
	</dependencies>
	
	<build>
		<plugins>
			<!-- <plugin>
			    <groupId>org.springframework.boot</groupId>
			    <artifactId>spring-boot-maven-plugin</artifactId>
			    <version>${boot.version}</version>
			    <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
			</plugin> -->
			
			<plugin>
	            <groupId>org.apache.maven.plugins</groupId>
	            <artifactId>maven-dependency-plugin</artifactId>
	            <version>${dependency.version}</version>
	            <configuration>
					<encoding>UTF-8</encoding>
				</configuration>
	            <executions>
	                <execution>
	                    <id>copy-dependencies</id>
	                    <phase>package</phase>
	                    <goals>
	                        <goal>copy-dependencies</goal>
	                    </goals>
	                    <configuration>
	                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
	                        <includeScope>compile</includeScope>
	                        <includeScope>runtime</includeScope>
	                    </configuration>
	                </execution>
	            </executions>
	        </plugin>
			<plugin>
			    <artifactId>maven-antrun-plugin</artifactId>
			    <version>${antrun.version}</version>
			    <executions>
			        <execution>
			            <phase>package</phase>
			            <goals>
			                <goal>run</goal>
			            </goals>
			            <configuration>
			                <tasks>
			                	<property name="classes.dir" value="${project.build.directory}/classes-exclude"/>
								<property name="lib.dir" value="${project.build.directory}/lib-exclude"/>
								
								<copy todir="${classes.dir}" includeEmptyDirs="false">
						        	<fileset dir="${project.build.directory}/classes">
						        	</fileset>
						        </copy>
						        <copy todir="${lib.dir}">
						        	<fileset dir="${project.build.directory}/lib"/>
						        </copy>
								
								<unjar dest="${classes.dir}" overwrite="false">
				                	<patternset>
				                		<include name="**/appd"/>
				                		<include name="**/*.sh"/>
				                		<include name="**/*.bat"/>
				                		<include name="**/readMe"/>
				                		
				                		<include name="**/*.xsd"/>
				                		<include name="**/*.xml"/>
				                		<include name="**/*.sql"/>
				                		<include name="**/*.ftl"/>
				                		<include name="**/*.yml"/>
				                		<include name="**/*.txt"/>
				                		<include name="**/*.conf"/>
				                		<include name="**/*.properties"/>
				                		<include name="**/*.setting"/>
				                		<include name="**/*.env"/>
										<include name="**/*.json"/>
										<include name="**/*.jks"/>
				                		
				                		<exclude name="**/*.map.xml"/>
				                		<exclude name="org/activiti/db/mapping/**/*.xml"/>
								    </patternset>
								    <fileset dir="${lib.dir}">
								        <include name="lc-*.jar"/>
								        <include name="ibps-*.jar"/>
								    </fileset>
			                	</unjar>
						        
								<property name="jarname" value="business.jar"/>
								<property name="jarfile.exclude.basedir" value="${project.build.directory}/${project.artifactId}-exclude"/>
								<property name="jarfile.exclude.name" value="${jarfile.exclude.basedir}/${jarname}"/>
								
						        <copy todir="${jarfile.exclude.basedir}" includeEmptyDirs="false">
						        	<fileset dir="${classes.dir}">
						        		<exclude name="**/*.class" />
						        	</fileset>
						        </copy>
						        <copy todir="${jarfile.exclude.basedir}/lib">
						        	<fileset dir="${lib.dir}"/>
						        </copy>
						        <pathconvert property="exclude.lib" pathsep=" ">
									<mapper>
										<chainedmapper>
											<flattenmapper />
											<globmapper from="*" to="lib/*" />
										</chainedmapper>
									</mapper>
									<fileset dir="${jarfile.exclude.basedir}/lib">
										<include name="*.jar" />
									</fileset>
								</pathconvert>
								<jar destfile="${jarfile.exclude.name}">
									<manifest>
								      	<attribute name="Class-Path" value=". ${exclude.lib}"/>
								      	<attribute name="Main-Class" value="com.lc.ibps.BusinessApplication"/>
								    </manifest>
							        <fileset dir="${classes.dir}">
							        	<include name="**/*.class" />
							        </fileset>
								</jar>
								
								<delete includeEmptyDirs="true">
								  	<fileset dir="${classes.dir}"/>
								  	<fileset dir="${lib.dir}"/>
								  	<fileset dir="${project.build.directory}/lib"/>
								</delete>
			                </tasks>
			            </configuration>
			        </execution>
			    </executions>
			</plugin>
		</plugins>
	</build>
</project>