pom.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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>licence</artifactId>
  7. <groupId>com.shcd</groupId>
  8. <version>1.0.0.RELEASE</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>client-offline</artifactId>
  12. <properties>
  13. <maven.compiler.source>8</maven.compiler.source>
  14. <maven.compiler.target>8</maven.compiler.target>
  15. </properties>
  16. <dependencies>
  17. <dependency>
  18. <groupId>org.springframework.boot</groupId>
  19. <artifactId>spring-boot-starter-web</artifactId>
  20. </dependency>
  21. <dependency>
  22. <groupId>com.shcd</groupId>
  23. <artifactId>core-licence</artifactId>
  24. <version>1.0.0.RELEASE</version>
  25. <scope>system</scope>
  26. <!-- 指定该 JAR 文件的路径 -->
  27. <systemPath>${project.basedir}/lib/core-licence-1.0.0.RELEASE.jar</systemPath>
  28. </dependency>
  29. </dependencies>
  30. <!-- 构建工具 -->
  31. <build>
  32. <plugins>
  33. <!-- 打包插件 -->
  34. <plugin>
  35. <groupId>org.springframework.boot</groupId>
  36. <artifactId>spring-boot-maven-plugin</artifactId>
  37. <configuration>
  38. <includeSystemScope>true</includeSystemScope>
  39. </configuration>
  40. </plugin>
  41. <plugin>
  42. <!--
  43. 1. 加密后,方法体被清空,保留方法参数、注解等信息.主要兼容swagger文档注解扫描
  44. 2. 方法体被清空后,反编译只能看到方法名和注解,看不到方法体的具体内容
  45. 3. 加密后的项目需要设置javaagent来启动,启动过程中解密class,完全内存解密,不留下任何解密后的文件
  46. 4. 启动加密后的jar,生成xxx-encrypted.jar,这个就是加密后的jar文件,加密后不可直接执行
  47. 5. 无密码启动方式,java -javaagent:xxx-encrypted.jar -jar xxx-encrypted.jar
  48. 6. 有密码启动方式,java -javaagent:xxx-encrypted.jar='-pwd= 密码' -jar xxx-encrypted.jar
  49. -->
  50. <groupId>net.roseboy</groupId>
  51. <artifactId>classfinal-maven-plugin</artifactId>
  52. <version>1.2.1</version>
  53. <configuration>
  54. <password>123456</password><!-- #表示启动时不需要密码,事实上对于代码混淆来说,这个密码没什么用,它只是一个启动密码 -->
  55. <excludes>org.spring</excludes>
  56. <packages>${groupId}</packages><!-- 加密的包名,多个包用逗号分开 -->
  57. <cfgfiles>application.yml,application-dev.yml</cfgfiles><!-- 加密的配置文件,多个包用逗号分开 -->
  58. <libjars>core-licence-1.0.0.RELEASE.jar</libjars> <!-- jar包lib下面要加密的jar依赖文件,多个包用逗号分开 -->
  59. </configuration>
  60. <executions>
  61. <execution>
  62. <phase>package</phase>
  63. <goals>
  64. <goal>classFinal</goal>
  65. </goals>
  66. </execution>
  67. </executions>
  68. </plugin>
  69. </plugins>
  70. </build>
  71. </project>