【发布时间】:2018-08-17 09:22:59
【问题描述】:
我尝试从 maven 插件运行 ProGuard,但出现错误:
[proguard] ProGuard, version 5.2.1
[proguard] java.io.IOException: Input jars and output jars must be different [D:\projects\demoObfuscation\target\demo-0.0.1-SNAPSHOT.jar].
[proguard] at proguard.ConfigurationChecker.checkConflicts(ConfigurationChecker.java:202)
[proguard] at proguard.ConfigurationChecker.check(ConfigurationChecker.java:82)
[proguard] at proguard.ProGuard.execute(ProGuard.java:73)
[proguard] at proguard.ProGuard.main(ProGuard.java:538)
在 proGuard 配置中我有这个:
-injars /target/demo-0.0.1-SNAPSHOT.jar
-outjars /target/demo-pro.jar
编辑:
带插件的最小 POM:
<build>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardInclude>${basedir}/proguard.conf</proguardInclude>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/jce.jar</lib>
</libs>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<mainClass>${start-class}</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
【问题讨论】:
-
你能提供一个最小的 POM 吗?
-
@norbjd 我编辑问题
-
-injars /target/demo-0.0.1-SNAPSHOT.jar应该是-injars target/demo-0.0.1-SNAPSHOT.jar
标签: java maven spring-boot proguard