Maven, Proguard and assembly issues

↘锁芯ラ 提交于 2019-11-28 18:48:54

Here is the configuration that had worked for me

<plugin>
    <groupId>com.pyx4me</groupId>
    <artifactId>proguard-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>proguard</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <obfuscate>true</obfuscate>
        <options>
            <option>-allowaccessmodification</option>
            <option>-keep public class com.class.path.MainClass { public *; public static *; }</option>
        </options>
        <injar>${project.build.finalName}.jar</injar>
        <outjar>${project.build.finalName}-small.jar</outjar>
        <outputDirectory>${project.build.directory}</outputDirectory>
        <libs>
            <lib>${java.home}/lib/rt.jar</lib>
            <lib>${java.home}/lib/jsse.jar</lib>
        </libs>
        <addMavenDescriptor>false</addMavenDescriptor>
    </configuration>
</plugin>

The final jar is the finalName-small.jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!