【发布时间】:2020-03-14 09:50:49
【问题描述】:
我在maven的pom.xml中写了需要的maven依赖,现在加proguard-maven-plugin混淆代码,希望不要混淆pom.xml中写的依赖
该项目依赖于很多 maven jars。有没有直接过滤所有maven jar的配置方法?
如何修改 pom.xml 或 proguard.cfg?
我的 pom.xml 的一部分
依赖:
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>${spring-data-redis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>${commons-pool2-version}</version>
</dependency>
</dependencies>
插件:
<plugin>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>6.0.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.14</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<attach>true</attach>
<attachArtifactClassifier>pg</attachArtifactClassifier>
<injar>original-${project.build.finalName}.jar</injar>
<outjar>original-${project.build.finalName}-pg.jar</outjar>
<obfuscate>true</obfuscate>
<proguardInclude>../proguard.cfg</proguardInclude>
</configuration>
</plugin>
混淆代码时如何过滤这两个依赖项?
【问题讨论】: