Improve Maven build (#1964)

- Specify missing plugin versions
- Fix or suppress ProGuard notes and warnings
This commit is contained in:
Marcono1234 2021-09-18 02:19:50 +02:00 committed by GitHub
parent b82c76717b
commit f1f90313fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 13 deletions

View File

@ -10,27 +10,25 @@
<artifactId>gson</artifactId>
<name>Gson</name>
<properties>
<proguardVersion>7.1.1</proguardVersion>
</properties>
<licenses>
<license>
<name>Apache-2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@ -111,14 +109,17 @@
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<phase>process-test-classes</phase>
<goals><goal>proguard</goal></goals>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>6.2.2</proguardVersion>
<proguardVersion>${proguardVersion}</proguardVersion>
<obfuscate>true</obfuscate>
<injar>test-classes-obfuscated-injar</injar>
<outjar>test-classes-obfuscated-outjar</outjar>
@ -131,9 +132,15 @@
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-core</artifactId>
<version>${proguardVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-base</artifactId>
<version>6.2.2</version>
<version>${proguardVersion}</version>
<scope>runtime</scope>
</dependency>
</dependencies>

View File

@ -3,6 +3,8 @@
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification
# On Windows mixed case class names might cause problems
-dontusemixedcaseclassnames
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod
-keepclassmembers enum * {
public static **[] values();
@ -17,4 +19,5 @@
-dontwarn com.google.gson.functional.EnumWithObfuscatedTest
-dontwarn junit.framework.TestCase
# Ignore notes about duplicate JDK classes
-dontnote module-info,jdk.internal.**

View File

@ -102,6 +102,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>