Skip to content

Commit

Permalink
Add unused Proguard plugin (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
gyk4j authored Apr 8, 2024
1 parent 966bfca commit 780d145
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
61 changes: 60 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,65 @@
</execution>
</executions>
</plugin>

<!-- Proguard
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.6.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<injar>${project.build.finalName}-jar-with-dependencies.jar</injar>
<outjar>${project.build.finalName}.jar</outjar>
<includeDependency>false</includeDependency>
<options>
<option>-dontwarn org.apache.commons.logging.impl.**</option>
<option>-dontwarn org.apache.log4j.**</option>
<option>-dontnote org.bouncycastle.**</option>
<option>-dontnote org.apache.commons.logging.impl.**</option>
<option>-dontnote org.apache.log4j.**</option>
<option>-dontnote net.sourceforge.argparse4j.**</option>
<option>-dontnote org.json.**</option>
<option>-dontnote org.slf4j.**</option>
<option>-keepclasseswithmembers public class * { public static
void main(java.lang.String[]); }</option>
<option>-keep class org.apache.commons.logging.** { *; }</option>
<option>-keep class org.apache.log4j.** { *; }</option>
<option>-keep class org.slf4j.** { *; }</option>
<option>-keep class org.bouncycastle.jcajce.provider.** { *; }</option>
<option>-keep class org.bouncycastle.jce.provider.** { *; }</option>
<option>-keep class net.sourceforge.argparse4j.internal.** { *; }</option>
</options>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/jsse.jar</lib>
<lib>${java.home}/lib/jce.jar</lib>
<lib>${java.home}/lib/ext/sunjce_provider.jar</lib>
</libs>
<assembly> <inclusions> <inclusion> <groupId>net.sourceforge.argparse4j</groupId>
<artifactId>argparse4j</artifactId> <library>true</library> </inclusion>
<inclusion> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId>
<library>true</library> </inclusion> <inclusion> <groupId>org.jxmapviewer</groupId>
<artifactId>jxmapviewer2</artifactId> <library>true</library> </inclusion>
<inclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId>
<library>true</library> </inclusion> <inclusion> <groupId>org.json</groupId>
<artifactId>json</artifactId> <library>true</library> </inclusion> <inclusion>
<groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk18on</artifactId>
<library>true</library> </inclusion> <inclusion> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <library>true</library> </inclusion> <inclusion>
<groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <library>true</library>
</inclusion> </inclusions> </assembly> <exclusions> <exclusion> </exclusion>
</exclusions>
</configuration>
</plugin>
-->
</plugins>
</build>

Expand Down Expand Up @@ -181,4 +240,4 @@
<version>2.0.7</version>
</dependency>
</dependencies>
</project>
</project>
14 changes: 14 additions & 0 deletions proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-injars target/wols-0.0.1-SNAPSHOT-jar-with-dependencies.jar
-outjars target/wols-0.0.1-SNAPSHOT.jar
-libraryjars "<java.home>/lib/rt.jar":"<java.home>/lib/jce.jar"
-dontwarn

-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}

-keep class org.apache.** { *; }
-keep class org.slf4j.** { *; }
-keep class org.bouncycastle.** { *; }

# :"/home/user/opt/eclipse/plugins/org.junit_4.13.0.v20200204-1500.jar":"/home/user/opt/eclipse/plugins/org.hamcrest.core_1.3.0.v20180420-1519.jar":"/home/user/opt/libs/bouncycastle/bcprov-jdk18on-172.jar":"/home/user/opt/libs/jcalendar-1.4/lib/jcalendar-1.4.jar":"/home/user/opt/libs/jxmapviewer2-2.6/jxmapviewer2-2.6.jar":"/home/user/opt/libs/commons-logging-1.2/commons-logging-1.2.jar":"/home/user/opt/libs/org.json/json-20230227.jar"

0 comments on commit 780d145

Please sign in to comment.