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

update module-info to mark optional dependencies as 'static' #1582

Open
prashantbhat opened this issue May 13, 2020 · 9 comments
Open

update module-info to mark optional dependencies as 'static' #1582

prashantbhat opened this issue May 13, 2020 · 9 comments

Comments

@prashantbhat
Copy link
Contributor

After updating to the release version 3.4.5, I get the following error. (using Java 11)

Error occurred during initialization of boot layer
java.lang.module.FindException: Module metrics.healthchecks not found, required by com.zaxxer.hikari

The module-info (release 3.4.5) defines following dependencies with requires directive:

requires hibernate.core;
requires javassist;
requires simpleclient;
requires metrics.core;
requires metrics.healthchecks;
requires micrometer.core;

For HikariCP, these dependencies are optional, as in the pom.xml.

Adding the static modifier makes them optional, as defined in java.lang.module package summary

'requires' directives that have the 'static' modifier express an optional dependence at run time

So, it will be very useful if these dependencies are changed to be static. Thanks.

@smironov
Copy link

Same issue on Java 14, using HikariCP 3.4.5

@brettwooldridge
Copy link
Owner

@prashantbhat @smironov Can one of you send a pull request?

@prashantbhat
Copy link
Contributor Author

Opened PR #1587 with an update to latest Slf4J to use it's correct module name. Please review.

@guyv
Copy link

guyv commented Sep 3, 2020

@brettwooldridge any chance of getting this merged and released?

brettwooldridge added a commit that referenced this issue Oct 15, 2020
…1587)

* #1582: update module-info to mark optional dependencies as 'static'

* update to hibernate.core release 5.4.16.Final and use its module name

Co-authored-by: Brett Wooldridge <brett.wooldridge@gmail.com>
@Frank-CG
Copy link

Is there any workaround for this error?

@Borwe
Copy link

Borwe commented Dec 1, 2020

It's December, and still no one is close?

@FanJups
Copy link

FanJups commented Dec 21, 2020

@prashantbhat Thanks for the update but I still has the same error

I work on a project using JAVA 11, MAVEN and JAVAFX13.

module-info.java looks like :

module com.mautourco.finance {
	requires javafx.controls;
	requires javafx.fxml;
	requires java.sql;
	requires javafx.base;
	requires javafx.graphics;
	requires com.zaxxer.hikari;
	
	opens com.mautourco.finance to javafx.fxml;
	opens com.mautourco.finance.controller to javafx.fxml;
	opens com.mautourco.finance.model to javafx.base;

	exports com.mautourco.finance;
}

I tried to add requires com.zaxxer.hikari.metrics but I got this : com.zaxxer.hikari.metrics cannot be resolved to a module

Please, any idea ?

@FanJups
Copy link

FanJups commented Dec 21, 2020

Downgrading to 2.4.7 works for me

		<dependency>
		    <groupId>com.zaxxer</groupId>
		    <artifactId>HikariCP</artifactId>
		    <version>2.4.7</version>
		    
		</dependency>


module com.mautourco.finance {
	requires javafx.controls;
	requires javafx.fxml;
	requires java.sql;
	requires javafx.base;
	requires javafx.graphics;

	requires HikariCP;
	

	opens com.mautourco.finance to javafx.fxml;
	opens com.mautourco.finance.controller to javafx.fxml;
	opens com.mautourco.finance.model to javafx.base;

	exports com.mautourco.finance;
}

@jngrx
Copy link

jngrx commented Jan 23, 2021

Hello !
I'm facing the same issue during Java 11+ migration
My projet is a Springboot 2.3.5 project with HikariCP 3.4.5 as dependency.
I see that this issue is known and a fix has been set up.

@brettwooldridge
Any idea why a new release is not done with this fix ?
No release since may 2020... Please help !

Thanks,
JN Grx

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

8 participants