From 6e0d1d51916e4f41e06c06e984a70ebd08352d95 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期四, 26 六月 2025 09:35:49 +0800
Subject: [PATCH] 打包加密jar包配置

---
 iailab-module-data/iailab-module-data-biz/pom.xml |   84 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/pom.xml b/iailab-module-data/iailab-module-data-biz/pom.xml
index e92acd3..696b87b 100644
--- a/iailab-module-data/iailab-module-data-biz/pom.xml
+++ b/iailab-module-data/iailab-module-data-biz/pom.xml
@@ -248,6 +248,12 @@
             <groupId>com.iailab</groupId>
             <artifactId>iailab-common-protection</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.openjdk.nashorn</groupId>
+            <artifactId>nashorn-core</artifactId>
+            <version>15.4</version>
+        </dependency>
         <!--        <dependency>-->
 <!--            <groupId>org.springframework.amqp</groupId>-->
 <!--            <artifactId>spring-rabbit</artifactId>-->
@@ -272,6 +278,84 @@
                     </execution>
                 </executions>
             </plugin>
+
+            <!--
+            class-winter插件
+            注:自Maven3.0.3起, 绑定到同一phase的Maven插件将按照pom.xml中声明的顺序执行
+            注:此插件最好放置在同一phase的最后执行。
+            注:此插件不具备打包功能,需要在此插件前有打包插件进行项目打包,否则加密不会生效。
+            -->
+            <plugin>
+                <groupId>com.idea-aedi</groupId>
+                <artifactId>class-winter-maven-plugin</artifactId>
+                <version>2.9.6</version>
+                <!-- 相关配置 -->
+                <configuration>
+                    <!-- <finalName></finalName>-->
+                    <includePrefix>com.iailab</includePrefix>
+                    <originJarOrWar>${project.build.directory}/${project.build.finalName}.jar</originJarOrWar>
+                    <excludePrefix>
+                        com.iailab.DataWebApplication,
+                        org.springframework,
+                        org.apache,
+                        javax,
+                        java,
+                        com.alibaba,
+                        io.swagger,
+                        cn.hutool,
+                        org.yaml.snakeyaml
+                    </excludePrefix>
+                    <!-- <includeXmlPrefix></includeXmlPrefix>-->
+                    <!-- <excludeXmlPrefix></excludeXmlPrefix>-->
+                    <!-- <toCleanXmlChildElementName></toCleanXmlChildElementName>-->
+                    <password>123123123</password>
+                    <!-- <includeLibs></includeLibs>-->
+                    <!-- <alreadyProtectedRootDir></alreadyProtectedRootDir>-->
+                    <!-- <alreadyProtectedLibs></alreadyProtectedLibs>-->
+                    <supportFile>${project.basedir}/dependency</supportFile>
+                    <!-- <jvmArgCheck></jvmArgCheck>-->
+                    <!-- <tips></tips>-->
+                    <!-- <debug></debug>-->
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>class-winter</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+<!--            <plugin>-->
+<!--                <groupId>org.apache.maven.plugins</groupId>-->
+<!--                <artifactId>maven-dependency-plugin</artifactId>-->
+<!--                <version>3.6.1</version>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <id>copy-dependencies</id>-->
+<!--                        <phase>package</phase>-->
+<!--                        <goals>-->
+<!--                            <goal>copy-dependencies</goal>-->
+<!--                        </goals>-->
+<!--                        <configuration>-->
+<!--                            <outputDirectory>${project.build.directory}/lib</outputDirectory>-->
+<!--                            <overWriteReleases>false</overWriteReleases>-->
+<!--                            <overWriteSnapshots>false</overWriteSnapshots>-->
+<!--                            <overWriteIfNewer>true</overWriteIfNewer>-->
+<!--                        </configuration>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--            </plugin>-->
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 </project>
\ No newline at end of file

--
Gitblit v1.9.3