<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
		 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.github.teakfly</groupId>
		<artifactId>teafly-common</artifactId>
		<version>1.0.30</version>
	</parent>

	<artifactId>teafly-common-security</artifactId>
	<packaging>jar</packaging>
	<description>teafly 安全工具类</description>
	<url>https://github.com/teakfly/teafly</url>

	<dependencies>
		<!--工具类核心包-->
		<dependency>
			<groupId>com.github.teakfly</groupId>
			<artifactId>teafly-common-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.baomidou</groupId>
			<artifactId>mybatis-plus-extension</artifactId>
		</dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-core</artifactId>
        </dependency>
		<!--安全模块 -->
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-oauth2</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-redis</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>com.github.wvengen</groupId>
				<artifactId>proguard-maven-plugin</artifactId>
				<version>2.3.1</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>proguard</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<proguardVersion>6.2.2</proguardVersion>
					<injar>${project.build.finalName}.jar</injar>
					<outjar>${project.build.finalName}.jar</outjar>
					<obfuscate>true</obfuscate>
					<options>
						<option>-dontshrink</option>
						<option>-dontoptimize</option>
						<option>-adaptclassstrings</option>
						<option>-ignorewarnings</option>
						<option>-optimizationpasses 5</option>
						<option>-dontusemixedcaseclassnames</option>
						<option>-dontwarn org.apache.logging.log4j.util.**</option>
						<option>-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod</option>
						<option>-repackageclasses 'com.github.teakfly.teafly.common.security.index'</option>
						<option>-allowaccessmodification</option>
						<option>-keepdirectories</option>
						<option>-useuniqueclassmembernames</option>
						<option>-dontnote javax.annotation.**</option>
						<option>-dontnote sun.applet.**</option>
						<option>-dontnote sun.tools.jar.**</option>
						<option>-dontnote org.apache.commons.logging.**</option>
						<option>-dontnote javax.inject.**</option>
						<option>-dontnote org.aopalliance.intercept.**</option>
						<option>-dontnote org.aopalliance.aop.**</option>
						<option>-dontnote org.apache.logging.log4j.**</option>
						<option>-dontnote module-info</option>
						<option>-keep class org.apache.logging.log4j.util.* { *; }</option>
						<option>-keep interface * extends * { *; }</option>
						<option>-keep class * implements java.io.Serializable </option>
						<option>-keep class com.github.teakfly.teafly.common.security.component.TeaflyUserAuthConverter</option>
						<option>-keep class com.github.teakfly.teafly.common.security.component.TeaflyAuthExceptionSerializer</option>
						<option>-keep class com.github.teakfly.teafly.common.security.component.TeaflyTokenEnhancer</option>
						<option>-keep class com.github.teakfly.teafly.common.security.component.TeaflyPreAuthChecks</option>
						<option>-keep class com.github.teakfly.teafly.common.security.component.PermissionService {public &lt;methods&gt;;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.handler.AbstractAuthFailureEvenHandler {public &lt;methods&gt;;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.handler.AbstractAuthSuccessEventHandler {public &lt;methods&gt;;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.interceptor.TeaflyFeignClientInterceptor
                            {public &lt;methods&gt;;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.util.AuthUtils {public &lt;methods&gt;;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.service.TeaflyUserDetailsService {*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.exception.TeaflyAuthException {*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.handler.RestResponseErrorHandler {*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.service.TeaflyUser{*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.component.TeaflyRedisTokenStore{*;}</option>

						<option>-keep class com.github.teakfly.teafly.common.security.serializer.AccessTokenJackson2Deserializer {*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.serializer.AccessTokenJackson2Serializer {*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.serializer.AccessTokenMixIn {*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.serializer.OAuth2AuthenticationDeserializer {*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.serializer.OAuth2AuthenticationMixin{*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.serializer.OAuth2RefreshTokenDeserializer{*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.serializer.OAuth2RefreshTokenMixin {*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.serializer.PreAuthenticationTokenDeserializer{*;}</option>
						<option>-keep class com.github.teakfly.teafly.common.security.serializer.PreAuthenticationTokenMixin{*;}</option>

						<option>-keep @org.springframework.boot.autoconfigure.SpringBootApplication class * {*;}</option>
						<option>-keepnames interface **</option>
						<option>-keepclassmembers enum * { *; }</option>
						<option>-keepclassmembers class * {
							@org.springframework.beans.factory.annotation.Autowired *;
							@org.springframework.beans.factory.annotation.Value *;
							}
						</option>
					</options>
					<injarNotExistsSkip>true</injarNotExistsSkip>
					<libs>
						<lib>${java.home}/lib/rt.jar</lib>
						<lib>${java.home}/lib/jce.jar</lib>
					</libs>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>net.sf.proguard</groupId>
						<artifactId>proguard-base</artifactId>
						<version>6.2.2</version>
						<scope>runtime</scope>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

	<licenses>
		<license>
			<name>GNU General Public License (GPL)</name>
			<url>https://opensource.org/licenses/gpl-license</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>teakfly</name>
			<email>teakfly@teakfly.com</email>
			<organization>teakfly</organization>
		</developer>
	</developers>

	<scm>
		<connection>scm:git://git@github.com:teakfly/teafly.git</connection>
		<developerConnection>scm:git://git@github.com:teakfly/teafly.git</developerConnection>
		<url>https://github.com/teakfly/teafly/tree/main</url>
	</scm>

</project>
