混淆配置,所有的包增加classifier为xj,只对biz包混淆,混淆后classifier为obf,profile配置写好,混淆打包时勾选biz-obf+default打包,不混淆时只勾选default
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<biz-classifier>xj</biz-classifier>
|
||||
<!-- 基础配置 -->
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
@@ -257,6 +258,13 @@
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-system-biz</artifactId>
|
||||
<version>${renkang.version}</version>
|
||||
<classifier>xj</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-system-biz</artifactId>
|
||||
<version>${renkang.version}</version>
|
||||
<classifier>obf</classifier>
|
||||
</dependency>
|
||||
|
||||
<!-- jeecg tools -->
|
||||
@@ -270,18 +278,21 @@
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-base-core</artifactId>
|
||||
<version>${jeecgboot-renkang.version}</version>
|
||||
<classifier>xj</classifier>
|
||||
</dependency>
|
||||
<!-- system 单体 api -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-system-local-api</artifactId>
|
||||
<version>${renkang.version}</version>
|
||||
<classifier>xj</classifier>
|
||||
</dependency>
|
||||
<!-- system 微服务 api -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-system-cloud-api</artifactId>
|
||||
<version>${renkang.version}</version>
|
||||
<classifier>xj</classifier>
|
||||
</dependency>
|
||||
|
||||
<!--微服务启动依赖-->
|
||||
@@ -646,6 +657,13 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<classifier>xj</classifier> <!-- 设置classifier -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- 指定JDK编译版本 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -728,12 +746,91 @@
|
||||
<configuration>
|
||||
<!--设置为true,以便把本地的system的jar也包括进来-->
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
<!-- 可选:为可执行包设置新 classifier -->
|
||||
<classifier>xj</classifier>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>biz-obf</id>
|
||||
<properties>
|
||||
<biz-classifier>obf</biz-classifier>
|
||||
</properties>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.github.wvengen</groupId>
|
||||
<artifactId>proguard-maven-plugin</artifactId>
|
||||
<version>2.7.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase> <!-- 在打包阶段执行混淆 -->
|
||||
<goals>
|
||||
<goal>proguard</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<putLibraryJarsInTempDir>true</putLibraryJarsInTempDir>
|
||||
<injar>${project.build.finalName}-xj.jar</injar>
|
||||
<outjar>${project.build.finalName}-obf.jar</outjar> <!-- 输出混淆后JAR -->
|
||||
<obfuscate>true</obfuscate>
|
||||
<libs>
|
||||
<lib>C:/Program Files/Eclipse Adoptium/jdk-8.0.452.9-hotspot/jre/lib/rt.jar
|
||||
</lib> <!-- JDK 核心库 -->
|
||||
</libs>
|
||||
<proguardInclude>proguard.cfg</proguardInclude> <!-- 模块独立规则 -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-obf-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>${project.build.directory}/${project.build.finalName}-obf.jar
|
||||
</file>
|
||||
<type>jar</type>
|
||||
<classifier>obf</classifier> <!-- 关键:标识混淆JAR -->
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/dependency</outputDirectory>
|
||||
<includeScope>provided</includeScope>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>local</id>
|
||||
<activation>
|
||||
@@ -810,6 +907,7 @@
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<classifier>xj</classifier>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>${start-class}</mainClass>
|
||||
|
||||
Reference in New Issue
Block a user