1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5+ <parent >
6+ <artifactId >springboot-learning</artifactId >
7+ <groupId >com.github.lybgeek</groupId >
8+ <version >0.0.1-SNAPSHOT</version >
9+ </parent >
10+ <modelVersion >4.0.0</modelVersion >
11+
12+ <artifactId >springboot-code-authorization</artifactId >
13+
14+
15+ <dependencies >
16+ <dependency >
17+ <groupId >org.springframework.boot</groupId >
18+ <artifactId >spring-boot-starter-web</artifactId >
19+ </dependency >
20+
21+ <dependency >
22+ <groupId >org.springframework.boot</groupId >
23+ <artifactId >spring-boot-starter-freemarker</artifactId >
24+ </dependency >
25+ <dependency >
26+ <groupId >com.baomidou</groupId >
27+ <artifactId >mybatis-plus-boot-starter</artifactId >
28+ </dependency >
29+ <dependency >
30+ <groupId >com.baomidou</groupId >
31+ <artifactId >mybatis-plus-generator</artifactId >
32+ </dependency >
33+ <dependency >
34+ <groupId >org.yaml</groupId >
35+ <artifactId >snakeyaml</artifactId >
36+ </dependency >
37+ <dependency >
38+ <groupId >com.alibaba</groupId >
39+ <artifactId >druid-spring-boot-starter</artifactId >
40+ </dependency >
41+
42+ <dependency >
43+ <groupId >org.springframework.boot</groupId >
44+ <artifactId >spring-boot-starter-aop</artifactId >
45+ </dependency >
46+
47+ <dependency >
48+ <groupId >cglib</groupId >
49+ <artifactId >cglib</artifactId >
50+ </dependency >
51+
52+ <dependency >
53+ <groupId >mysql</groupId >
54+ <artifactId >mysql-connector-java</artifactId >
55+ <scope >runtime</scope >
56+ </dependency >
57+ <dependency >
58+ <groupId >org.springframework.boot</groupId >
59+ <artifactId >spring-boot-configuration-processor</artifactId >
60+ <optional >true</optional >
61+ </dependency >
62+ <dependency >
63+ <groupId >org.springframework.boot</groupId >
64+ <artifactId >spring-boot-starter-test</artifactId >
65+ <scope >test</scope >
66+ </dependency >
67+
68+ <dependency >
69+ <groupId >org.apache.commons</groupId >
70+ <artifactId >commons-lang3</artifactId >
71+ </dependency >
72+ <dependency >
73+ <groupId >org.mybatis.spring.boot</groupId >
74+ <artifactId >mybatis-spring-boot-starter</artifactId >
75+ </dependency >
76+
77+ </dependencies >
78+
79+ <build >
80+ <plugins >
81+ <plugin >
82+ <groupId >org.springframework.boot</groupId >
83+ <artifactId >spring-boot-maven-plugin</artifactId >
84+ </plugin >
85+
86+ <plugin >
87+ <groupId >com.github.wvengen</groupId >
88+ <artifactId >proguard-maven-plugin</artifactId >
89+ <version >2.0.14</version >
90+ <executions >
91+ <execution >
92+ <!-- 混淆时刻,这里是打包的时候混淆-->
93+ <phase >package</phase >
94+ <goals >
95+ <!-- 使用插件的什么功能: 混淆-->
96+ <goal >proguard</goal >
97+ </goals >
98+ </execution >
99+ </executions >
100+ <configuration >
101+ <proguardVersion >6.0.2</proguardVersion >
102+ <!-- 是否将生成的PG文件安装部署-->
103+ <attach >true</attach >
104+ <!-- 是否混淆-->
105+ <obfuscate >true</obfuscate >
106+ <!-- 指定生成文件分类 -->
107+ <attachArtifactClassifier >pg</attachArtifactClassifier >
108+ <options >
109+ <!-- JDK目标版本1.8-->
110+ <option >-target 1.8</option >
111+ <!-- 不做收缩(删除注释、未被引用代码)-->
112+ <option >-dontshrink</option >
113+ <!-- 不做优化(变更代码实现逻辑)-->
114+ <option >-dontoptimize</option >
115+ <!-- 不路过非公用类文件及成员-->
116+ <option >-dontskipnonpubliclibraryclasses</option >
117+ <option >-dontskipnonpubliclibraryclassmembers</option >
118+ <!-- 优化时允许访问并修改有修饰符的类和类的成员 -->
119+ <option >-allowaccessmodification</option >
120+ <!-- 确定统一的混淆类的成员名称来增加混淆-->
121+ <option >-useuniqueclassmembernames</option >
122+
123+ <!-- 保证spring注解能力-->
124+ <option >-keepdirectories</option >
125+
126+ <!-- 不混淆所有包名,本人测试混淆后WEB项目问题实在太多,毕竟Spring配置中有大量固定写法的包名-->
127+ <option >-keeppackagenames</option >
128+ <!-- 不混淆所有特殊的类-->
129+ <option >-keepattributes
130+ Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod
131+ </option >
132+ <!-- 不混淆所有的set/get方法,毕竟项目中使用的部分第三方框架(例如Shiro)会用到大量的set/get映射-->
133+ <option >-keepclassmembers public class * {void set*(***);*** get*();}</option >
134+
135+ <option >-keep class com.github.lybgeek.user.**.entity.** {*;}</option >
136+ <option >-keep class com.fuse.cdn.api.modules.**.dto.** {*;}</option >
137+
138+
139+ <!-- 以下包因为大部分是Spring管理的Bean,不对包类的类名进行混淆,但对类中的属性和方法混淆-->
140+ <option >-keep class com.github.lybgeek.user.**.controller.**</option >
141+ <option >-keep class com.github.lybgeek.user.**.service.**</option >
142+ <option >-keep class ccom.github.lybgeek.user.**.dao.**{*;}</option >
143+
144+
145+ <!-- 不混淆启动类,否则spring-boot不能正常启动 -->
146+ <option >-keep class com.github.lybgeek.CodeAuthorizationApplication</option >
147+
148+ <!-- 忽略打包时的告警信息 -->
149+ <option >-ignorewarnings</option >
150+
151+ </options >
152+ <outjar >${project.build.finalName} </outjar >
153+ <!-- 添加依赖,这里你可以按你的需要修改,这里测试只需要一个JRE的Runtime包就行了 -->
154+ <libs >
155+ <lib >${java.home} /lib/rt.jar</lib >
156+ <lib >${java.home} /lib/jce.jar</lib >
157+ </libs >
158+ <outputDirectory >${project.build.directory} </outputDirectory >
159+ </configuration >
160+ <dependencies >
161+ <dependency >
162+ <groupId >net.sf.proguard</groupId >
163+ <artifactId >proguard-base</artifactId >
164+ <version >6.0.2</version >
165+ <scope >runtime</scope >
166+ </dependency >
167+ </dependencies >
168+ </plugin >
169+ </plugins >
170+ </build >
171+
172+
173+ </project >
0 commit comments