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

Remove implicitly-included java.base dep in module-info.java #402

Closed
UkonnRa opened this issue Dec 29, 2020 · 2 comments
Closed

Remove implicitly-included java.base dep in module-info.java #402

UkonnRa opened this issue Dec 29, 2020 · 2 comments
Labels
Milestone

Comments

@UkonnRa
Copy link

UkonnRa commented Dec 29, 2020

Describe the bug
Same as this issue, java.base is implicitly-included so you cannot add it again, or exception will be thrown

java.lang.module.FindException: Error reading module: ./.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-kotlin/2.12.0/dd04be85f79db0146223bd06696798937eac70d3/jackson-module-kotlin-2.12.0.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Dependence upon java.base already declared
:absolem:test (Thread[Execution worker for ':',5,main]) completed. Took 0.228 secs.

To Reproduce
Use jackson-kotlin with Java module, you will see this error

Expected behavior
Everything should work fine

Versions
Kotlin: 1.4.30-M1
Jackson-module-kotlin: 2.12.0
Jackson-databind: 2.12.0

@cowtowncoder
Copy link
Member

@UkonnRa First of all, thank you for reporting it. While it's unfortunate no one spotted this with 2.12.0-rc2 we at least have a chance to improve this for 2.12.1.
Bust just to make: it sounds like we so should just remove requires java.base? That does not seem to be included in any other module-info.java declarations (for Jackson modules) so seems unnecessary (plus since it's the core piece of JDK it should always be there anyway). It seems odd to me that this should cause problems (while redundant, why would this cause failure?) but I don't really know or use JPMS at this point so perhaps there is a good reason; or maybe it's an oddity of some specific piece of tooling. Either way if it is not needed but causes problems we should remove it.

@GedMarc WDYT?

@cowtowncoder cowtowncoder changed the title Remove implicitly-included java.base dep in module-info Remove implicitly-included java.base dep in module-info.java Dec 31, 2020
cowtowncoder added a commit that referenced this issue Dec 31, 2020
@cowtowncoder cowtowncoder added this to the 2.12.1 milestone Dec 31, 2020
@cowtowncoder
Copy link
Member

Removed unnecessary java.base and also fixed incorrect reference (was com.fasterxml.jackson.annotations, should be com.fasterxml.jackson.annotation (no trailing "s")). Will push 2.12.1-SNAPSHOT if anyone could test and verify that things now work better.

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

No branches or pull requests

2 participants