<!-- 配置加密插件
参看 https://gitee.com/roseboy/classfinal
参看 https://www.oschina.net/p/classfinal
参数说明
-file 加密的jar/war完整路径
-packages 加密的包名(可为空,多个用","分割)
-libjars jar/war包lib下要加密jar文件名(可为空,多个用","分割)
-cfgfiles 需要加密的配置文件,一般是classes目录下的yml或properties文件(可为空,多个用","分割)
-exclude 排除的类名(可为空,多个用","分割)
-classpath 外部依赖的jar目录,例如/tomcat/lib(可为空,多个用","分割)
-pwd 加密密码,如果是#号,则使用无密码模式加密
-code 机器码,在绑定的机器生成,加密后只可在此机器上运行
-Y 无需确认,不加此参数会提示确认以上信息
-->
<plugin>
<groupId>net.roseboy</groupId>
<artifactId>classfinal-maven-plugin</artifactId>
<version>1.1.9</version>
<configuration>
<password>000000</password><!--加密打包之后pom.xml会被删除,不用担心在jar包里找到此密码-->
<packages>com.hanshow</packages>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>classFinal</goal>
</goals>
</execution>
</executions>
</plugin>
上传classfinal-fatjar.jar到tomcat的bin目录
编辑catalina.sh
增加CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -javaagent:classfinal-fatjar.jar='-pwd 000000'"