Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore missing library entries #350

Open
ebourg opened this issue Jun 28, 2024 · 5 comments
Open

Ignore missing library entries #350

ebourg opened this issue Jun 28, 2024 · 5 comments

Comments

@ebourg
Copy link

ebourg commented Jun 28, 2024

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?

@lasselindqvist
Copy link
Collaborator

I will not be adding anything to support Java 8 or earlier. It is time to move on.

@ebourg
Copy link
Author

ebourg commented Jun 28, 2024

The same situation may arise in later JDKs when new modules are introduced though. Would you object to a 10 line PR addressing this issue?

@lasselindqvist
Copy link
Collaborator

If it fixes issues between using 11, 17 and 21 and so on, then it should be fixed yes. I would merge such a PR.

@rhoehener
Copy link

rhoehener commented Aug 19, 2024

It is time to move on.

Agreed, that's why it would be nice if there was a migration path that allows legacy system to switch. We can't just do this in one day, first we need testing, then a time when we probably need to be able to build with both java 8 and modern Java, and finally only modern Java.

Also please note that the documentation only has Java 8 examples: https://wvengen.github.io/proguard-maven-plugin/

@lasselindqvist
Copy link
Collaborator

You are right and I would be happy to merge and release any new contributions to examples. They are quite outdated. You (or anyone else) can target gh-pages branch: https://github.com/wvengen/proguard-maven-plugin/tree/gh-pages

If you need very long-lived support for many Java versions there are some, for example #355 (comment)
Other possibilites are of course difference development branches, profiles or environmental variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants