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

[question] Is it possible to configure the plugin so that it will work with both JDK 8 and 11/17/...? #355

Open
rhoehener opened this issue Aug 19, 2024 · 2 comments

Comments

@rhoehener
Copy link

rhoehener commented Aug 19, 2024

We're in the process of migrating projects from Java 8 to 11/17. For now, the target compilation level will remain 8 but I am already testing the build with JDK 17.

I learned that I have to change

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

to

<libs>
  <lib>${java.home}/jmods</lib>
</libs>

Is there a Java version agnostic configuration syntax or some other way to tell the plugin to just use whatever is in java.home?

(I am also missing configuration examples for modern Java versions in the documentation)

@lasselindqvist
Copy link
Collaborator

Similar problem is discussed in #350

You might want to open an issue with Proguard itself https://github.com/Guardsquare/proguard-core / https://github.com/Guardsquare/proguard

to make this whole lib passing automatic.

@rhoehener
Copy link
Author

rhoehener commented Aug 19, 2024

My current solution (might be of interest for people in the same situation).

Projects that use specific execution-ids need to define their own jdk-11+ profile with configuration for each execution.

    <profile>
      <id>jdk-11-on</id>
      <activation>
        <jdk>[11,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.wvengen</groupId>
            <artifactId>proguard-maven-plugin</artifactId>
            <configuration>
              <libs>
                <lib>${java.home}/jmods</lib>
              </libs>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

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

2 participants