From 37dcf77aae7959a495b41bbd206327f7ad572647 Mon Sep 17 00:00:00 2001 From: Liam Sharp Date: Fri, 15 Dec 2017 16:37:56 +0000 Subject: [PATCH] Add support for Java 9 multi release jars #61 - Make this a configurable property based on feedback from @FibreFoX --- .../wvengen/maven/proguard/ProGuardMojo.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/wvengen/maven/proguard/ProGuardMojo.java b/src/main/java/com/github/wvengen/maven/proguard/ProGuardMojo.java index 0078b6f1..88c2c6ef 100644 --- a/src/main/java/com/github/wvengen/maven/proguard/ProGuardMojo.java +++ b/src/main/java/com/github/wvengen/maven/proguard/ProGuardMojo.java @@ -60,12 +60,6 @@ public class ProGuardMojo extends AbstractMojo { - /** - * Proguard doesn't support Java 9. It can hower work with multi version jars - * we just need to ignore the higher versions. - */ - private static final String MULTI_VERSION_JAR_EXCLUSION = "(!META-INF/versions/**)"; - /** * Set this to 'true' to bypass ProGuard processing entirely. * @@ -129,7 +123,13 @@ public class ProGuardMojo extends AbstractMojo { * @parameter default-value="false" */ private boolean putLibraryJarsInTempDir; - + + /** + * Sets an exclude for all library jars, eg: (!META-INF/versions/**) + * + * @parameter default-value="" + */ + private String libraryJarExclusion; /** * Specifies that project compile dependencies should be added as injar. @@ -689,7 +689,9 @@ private void addLibraryJar(ArrayList args, ArrayList libraryJars, } else { args.add("-libraryjars"); args.add(fileToString(file)); - args.add(MULTI_VERSION_JAR_EXCLUSION); + if (libraryJarExclusion != null) { + args.add(libraryJarExclusion); + } } }