GradleUp / shadow

Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin.
https://www.gradleup.com/shadow/
Apache License 2.0
3.69k stars 389 forks source link

minimize() incompatible with hikari #972

Open SergioK29 opened 3 days ago

SergioK29 commented 3 days ago

Expected and Results

minimize() shouldn't break jars using hikari

Related environent and versions

No response

Reproduction steps

HikariConfig config = new HikariConfig(); config.setDriverClassName("com.mysql.cj.jdbc.Driver");

if minimize() step is done, error:

Exception in thread "main" java.lang.RuntimeException: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader at com.zaxxer.hikari.HikariConfig.setDriverClassName(HikariConfig.java:494) at me.test.webserver.MySQLStorageProvider.(MySQLStorageProvider.java:35) at me.test.webserver.WebServer.main(WebServer.java:63)

Anything else?

The breakage is probably because reflection, will shadow ever plan to support reflection for minimize step?

Goooler commented 3 days ago

Can you address a reproducer?

SergioK29 commented 3 days ago

Can you address a reproducer?

what?

Goooler commented 3 days ago

A project to reproduce this issue.

SergioK29 commented 3 days ago

A project to reproduce this issue.

its just those 2 lines of code?

using library implementation("com.zaxxer:HikariCP:5.1.0") and implementation("com.mysql:mysql-connector-j:9.0.0") java 21 com.gradleup.shadow 8.3.0