proguard-maven-plugin icon indicating copy to clipboard operation
proguard-maven-plugin copied to clipboard

Ignore missing library entries

Open ebourg opened this issue 1 week ago • 3 comments

I've some troubles supporting both Java 8 and Java 9+ with the same plugin configuration. For example to build with Java 8 I use this:

  <libs>
    <lib>${java.home}/lib/rt.jar</lib>
  </libs>

and for Java 9+ I use this:

  <libs>
    <lib>${java.home}/jmods/java.base.jmod</lib>
    <lib>${java.home}/jmods/java.logging.jmod</lib>
    <lib>${java.home}/jmods/java.sql.jmod</lib>
  </libs>

But I can't use a mixed configuration:

  <libs>
    <lib>${java.home}/lib/rt.jar</lib>
    <lib>${java.home}/jmods/java.base.jmod</lib>
    <lib>${java.home}/jmods/java.logging.jmod</lib>
    <lib>${java.home}/jmods/java.sql.jmod</lib>
  </libs>

In this case Proguard complains about missing files.

The workaround is to duplicate the whole plugin configuration in two different profiles, but I'd like to avoid adding 50 lines of plugin declaration for this.

Would it be possible to modify the plugin to check if the libraries listed exist before using them and ignore those that are missing?

ebourg avatar Jun 28 '24 07:06 ebourg