Skip to content

Commit 37dcf77

Browse files
committed
Add support for Java 9 multi release jars wvengen#61
- Make this a configurable property based on feedback from @FibreFoX
1 parent 387f521 commit 37dcf77

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/main/java/com/github/wvengen/maven/proguard/ProGuardMojo.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@
6060

6161
public class ProGuardMojo extends AbstractMojo {
6262

63-
/**
64-
* Proguard doesn't support Java 9. It can hower work with multi version jars
65-
* we just need to ignore the higher versions.
66-
*/
67-
private static final String MULTI_VERSION_JAR_EXCLUSION = "(!META-INF/versions/**)";
68-
6963
/**
7064
* Set this to 'true' to bypass ProGuard processing entirely.
7165
*
@@ -129,7 +123,13 @@ public class ProGuardMojo extends AbstractMojo {
129123
* @parameter default-value="false"
130124
*/
131125
private boolean putLibraryJarsInTempDir;
132-
126+
127+
/**
128+
* Sets an exclude for all library jars, eg: (!META-INF/versions/**)
129+
*
130+
* @parameter default-value=""
131+
*/
132+
private String libraryJarExclusion;
133133

134134
/**
135135
* Specifies that project compile dependencies should be added as injar.
@@ -689,7 +689,9 @@ private void addLibraryJar(ArrayList<String> args, ArrayList<File> libraryJars,
689689
} else {
690690
args.add("-libraryjars");
691691
args.add(fileToString(file));
692-
args.add(MULTI_VERSION_JAR_EXCLUSION);
692+
if (libraryJarExclusion != null) {
693+
args.add(libraryJarExclusion);
694+
}
693695
}
694696
}
695697

0 commit comments

Comments
 (0)