# springboot-jar-encry-maven-plugin
**Repository Path**: Rezar/springboot-jar-encry-maven-plugin
## Basic Information
- **Project Name**: springboot-jar-encry-maven-plugin
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-03-16
- **Last Updated**: 2022-03-21
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# springboot-jar-encry-maven-plugin
mvn插件,加密运行springboot jar项目
1. 在maven test阶段后修改编译后的数据,加密相关字节码文件和资源文件;同时在当前目录生成解密文件decry.psd;
2. 覆盖原有SpringBoot启动类,添加自定义加载器,需要当前目录下存在decry.psd文件并且密码正确才能正常启动jar项目
# 引入:
pom.xml文件添加
```
org.springframework.boot
spring-boot-maven-plugin
com.mojin.kernel
springboot-class-encry-maven-plugin
0.0.1-SNAPSHOT
com.yusheng.ssp.applications.WorkCounterApplication
application.yaml
com/yusheng/ssp/RedirectGeneralKernelApplication\.class
fadfsdfljgaojiebladf
false
encry
```
pom.xml 添加仓库
```
Rezar-mvn-repo
https://github.com/rezar1/springboot-encry-maven-plguin/tree/main/springboot-class-encry-maven-plugin/repo
```
项目目录下执行打包命令,即可生成加密后的jar和decry.psd文件;
# 注意!!!!
为避免内存嗅探,建议在jvm启动时添加[-XX:+DisableAttachMechanism]参数,禁止classdump这类操作(ps:同时会禁止掉jstack,jmap等此类工具,权衡使用)