Skip to content

Commit f1f9031

Browse files
authored
Improve Maven build (#1964)
- Specify missing plugin versions - Fix or suppress ProGuard notes and warnings
1 parent b82c767 commit f1f9031

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

gson/pom.xml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,25 @@
1010
<artifactId>gson</artifactId>
1111
<name>Gson</name>
1212

13+
<properties>
14+
<proguardVersion>7.1.1</proguardVersion>
15+
</properties>
16+
1317
<licenses>
1418
<license>
1519
<name>Apache-2.0</name>
1620
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
1721
</license>
1822
</licenses>
19-
23+
2024
<dependencies>
2125
<dependency>
2226
<groupId>junit</groupId>
2327
<artifactId>junit</artifactId>
2428
<scope>test</scope>
2529
</dependency>
26-
<dependency>
27-
<groupId>com.github.wvengen</groupId>
28-
<artifactId>proguard-maven-plugin</artifactId>
29-
<version>2.4.0</version>
30-
<scope>test</scope>
31-
</dependency>
3230
</dependencies>
33-
31+
3432
<build>
3533
<plugins>
3634
<plugin>
@@ -111,14 +109,17 @@
111109
<plugin>
112110
<groupId>com.github.wvengen</groupId>
113111
<artifactId>proguard-maven-plugin</artifactId>
112+
<version>2.4.0</version>
114113
<executions>
115114
<execution>
116115
<phase>process-test-classes</phase>
117-
<goals><goal>proguard</goal></goals>
116+
<goals>
117+
<goal>proguard</goal>
118+
</goals>
118119
</execution>
119120
</executions>
120121
<configuration>
121-
<proguardVersion>6.2.2</proguardVersion>
122+
<proguardVersion>${proguardVersion}</proguardVersion>
122123
<obfuscate>true</obfuscate>
123124
<injar>test-classes-obfuscated-injar</injar>
124125
<outjar>test-classes-obfuscated-outjar</outjar>
@@ -131,9 +132,15 @@
131132
</configuration>
132133
<dependencies>
133134
<dependency>
134-
<groupId>net.sf.proguard</groupId>
135+
<groupId>com.guardsquare</groupId>
136+
<artifactId>proguard-core</artifactId>
137+
<version>${proguardVersion}</version>
138+
<scope>runtime</scope>
139+
</dependency>
140+
<dependency>
141+
<groupId>com.guardsquare</groupId>
135142
<artifactId>proguard-base</artifactId>
136-
<version>6.2.2</version>
143+
<version>${proguardVersion}</version>
137144
<scope>runtime</scope>
138145
</dependency>
139146
</dependencies>

gson/src/test/resources/testcases-proguard.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
44
-optimizationpasses 5
55
-allowaccessmodification
6+
# On Windows mixed case class names might cause problems
7+
-dontusemixedcaseclassnames
68
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod
79
-keepclassmembers enum * {
810
public static **[] values();
@@ -17,4 +19,5 @@
1719

1820
-dontwarn com.google.gson.functional.EnumWithObfuscatedTest
1921
-dontwarn junit.framework.TestCase
20-
22+
# Ignore notes about duplicate JDK classes
23+
-dontnote module-info,jdk.internal.**

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
<plugin>
103103
<groupId>org.apache.maven.plugins</groupId>
104104
<artifactId>maven-jar-plugin</artifactId>
105+
<version>3.2.0</version>
105106
</plugin>
106107
<plugin>
107108
<groupId>org.apache.felix</groupId>

0 commit comments

Comments
 (0)