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

	<modelVersion>4.0.0</modelVersion>
	<artifactId>ibps-oauth-server2</artifactId>

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

	<dependencies>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-i18n</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-discovery</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>org.junit.jupiter</groupId>
					<artifactId>junit-jupiter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.mockito</groupId>
					<artifactId>mockito-junit-jupiter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.cloud</groupId>
					<artifactId>ibps-basic-config-nacos</artifactId>
				</exclusion>
				<exclusion>
					<groupId>net.sf.ezmorph</groupId>
					<artifactId>ezmorph</artifactId>
				</exclusion>
				<exclusion>
					<groupId>net.sf.morph</groupId>
					<artifactId>morph</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.google.code.gson</groupId>
					<artifactId>gson</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.xerial.snappy</groupId>
					<artifactId>snappy-java</artifactId>
				</exclusion>
				<exclusion>
					<groupId>de.ruedigermoeller</groupId>
					<artifactId>fst</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.jfirer</groupId>
					<artifactId>Fse</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.esotericsoftware</groupId>
					<artifactId>kryo-shaded</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>
				<exclusion>
					<groupId>org.codehaus.groovy</groupId>
					<artifactId>groovy</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.codehaus.groovy</groupId>
					<artifactId>groovy-jsr223</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.kohsuke</groupId>
					<artifactId>groovy-sandbox</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<!-- undertow -->
		<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.cloud</groupId>
			<artifactId>ibps-basic-validator</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>redis.clients</groupId>
					<artifactId>jedis</artifactId>
				</exclusion>
				<exclusion>
					<groupId>net.sf.json-lib</groupId>
					<artifactId>json-lib</artifactId>
				</exclusion>
				<exclusion>
					<groupId>de.ruedigermoeller</groupId>
					<artifactId>fst</artifactId>
				</exclusion>
				<exclusion>
					<groupId>cn.hippo4j</groupId>
					<artifactId>hippo4j-spring-boot-starter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.springframework.data</groupId>
					<artifactId>spring-data-elasticsearch</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-provider</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>io.micrometer</groupId>
					<artifactId>
						micrometer-registry-prometheus
					</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.github.mweirauch</groupId>
					<artifactId>micrometer-jvm-extras</artifactId>
				</exclusion>
				<exclusion>
					<groupId>net.bull.javamelody</groupId>
					<artifactId>javamelody-core</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<!-- response -->
		<dependency>
			<groupId>com.lc.ibps.base</groupId>
			<artifactId>ibps-base-cloud</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>dm.jdbc</groupId>
					<artifactId>DmJdbcDriver</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-response</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>com.esotericsoftware</groupId>
					<artifactId>kryo-shaded</artifactId>
				</exclusion>
				<exclusion>
					<groupId>cn.hippo4j</groupId>
					<artifactId>hippo4j-spring-boot-starter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.cloud</groupId>
					<artifactId>ibps-basic-monitor</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - start -->
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-loadbalancer</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-client</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-openfeign</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.bouncycastle</groupId>
					<artifactId>bcpkix-jdk15on</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework.cloud</groupId>
					<artifactId>spring-cloud-netflix-ribbon</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<!-- swagger ui -->
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-basic-swagger</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-oauth-base</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.cloud</groupId>
			<artifactId>ibps-oauth-server2-default</artifactId>
			<!-- 应用瘦身 - start -->
			<exclusions>
				<exclusion>
					<groupId>com.google.code.gson</groupId>
					<artifactId>gson</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.googlecode.xmemcached</groupId>
					<artifactId>xmemcached</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.mchange</groupId>
					<artifactId>c3p0</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.components</groupId>
					<artifactId>ibps-component-quartz</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.model</groupId>
					<artifactId>ibps-msg-model</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.common</groupId>
					<artifactId>ibps-msg-biz</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.message</groupId>
					<artifactId>ibps-message-producer</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.cloud</groupId>
					<artifactId>ibps-basic-monitor</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.lc.ibps.base</groupId>
					<artifactId>ibps-base-elasticsearch</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.bouncycastle</groupId>
					<artifactId>bcprov-jdk15on</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.bouncycastle</groupId>
					<artifactId>bcprov-jdk15to18</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - end -->
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.components</groupId>
			<artifactId>ibps-component-sms</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.provider.base</groupId>
			<artifactId>ibps-provider-platform-client</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.apache.cxf</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-core</artifactId>
		</dependency>
		
		<!-- TODO 租户模式下添加该依赖 start -->
		<!-- 发布版本需要删除该依赖 -->
		<!--
		-->
		<dependency>
			<groupId>com.lc.ibps.saas</groupId>
			<artifactId>ibps-saas-base-feign</artifactId>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.saas</groupId>
			<artifactId>ibps-saas-biz</artifactId>
			<exclusions>
				<exclusion>
					<groupId>com.lc.ibps.cloud</groupId>
					<artifactId>ibps-oauth-client2</artifactId>
				</exclusion>
				<!-- 应用瘦身 - start -->
				<exclusion>
					<groupId>org.springframework.kafka</groupId>
					<artifactId>spring-kafka</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.apache.kafka</groupId>
					<artifactId>kafka-streams</artifactId>
				</exclusion>
				<!-- 应用瘦身 - end -->
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.lc.ibps.saas</groupId>
			<artifactId>ibps-provider-saas-client</artifactId>
		</dependency>
		<!-- TODO 租户模式下添加该依赖 end -->
		
		<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>fakepath</groupId>
		    <artifactId>sqlite-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</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.oracle</groupId>
			<artifactId>oracledriver</artifactId>
		</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>com.microsoft.sqlserver</groupId>
		    <artifactId>mssql-jdbc</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.junit.jupiter</groupId>
					<artifactId>junit-jupiter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.mockito</groupId>
					<artifactId>mockito-junit-jupiter</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.jayway.jsonpath</groupId>
					<artifactId>json-path</artifactId>
				</exclusion>
				<exclusion>
					<groupId>net.minidev</groupId>
					<artifactId>json-smart</artifactId>
				</exclusion>
			</exclusions>
			<!-- 应用瘦身 - start -->
		</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="**/*.yml" />
										<include name="**/*.txt" />
										<include name="**/*.properties" />
										<include name="**/*.setting"/>
										<include name="**/*.conf"/>
										<include name="**/*.env"/>
										<include name="**/*.json"/>
										<include name="**/*.jks"/>

										<exclude name="**/*.map.xml" />
										<exclude name="org/activiti/engine/mapping/**/*.xml" />
									</patternset>
									<fileset dir="${lib.dir}">
										<include name="lc-*.jar" />
										<include name="ibps-*.jar" />
									</fileset>
								</unjar>

								<property name="jarname" value="oauth2server.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.OAuth2ServerApplication2" />
									</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>