Skip to content

Commit

Permalink
Add support for Java 9 multi release jars wvengen#61
Browse files Browse the repository at this point in the history
- Make this a configurable property based on feedback from @FibreFoX
  • Loading branch information
liamsharp committed Dec 15, 2017
1 parent 387f521 commit 37dcf77
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main/java/com/github/wvengen/maven/proguard/ProGuardMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -689,7 +689,9 @@ private void addLibraryJar(ArrayList<String> args, ArrayList<File> libraryJars,
} else {
args.add("-libraryjars");
args.add(fileToString(file));
args.add(MULTI_VERSION_JAR_EXCLUSION);
if (libraryJarExclusion != null) {
args.add(libraryJarExclusion);
}
}
}

Expand Down

0 comments on commit 37dcf77

Please sign in to comment.