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

Eclipse having issues duemodule-info class "lost" on 2.18.0 jars #4727

Closed
bwzhang2011 opened this issue Oct 1, 2024 · 19 comments
Closed

Eclipse having issues duemodule-info class "lost" on 2.18.0 jars #4727

bwzhang2011 opened this issue Oct 1, 2024 · 19 comments
Labels
Milestone

Comments

@bwzhang2011
Copy link

bwzhang2011 commented Oct 1, 2024

Describe the bug

module info lost during the release since jackson-databind 2.18.0 version while correct in early version released like 2.17.2. notice that 2.17.2 is correct for databind core and annotation package. I recommend new deployed version to be released which could help the upgration of jacskon

Version Information

2.18.0

Reproduction

Not given

Expected behavior

no error while import module class support

Additional context

None

@bwzhang2011 bwzhang2011 added the to-evaluate Issue that has been received but not yet evaluated label Oct 1, 2024
@pjfanning
Copy link
Member

pjfanning commented Oct 1, 2024

Can you give more details? The issue is in jackson-databind 2.18.0 jar and only that jar?

I downloaded jackson-databind 2.18.0 jar and it has:

 1496  09-26-2024 18:56   META-INF/versions/9/module-info.class

@AndreasWBartels
Copy link

compile with maven 3.9.5 (and newer) with jdk21 works (openjdk and temurin)

eclipse does not seem to be able to handle the multi version jar which it can with 2.17.2.

tested with eclipse 2024-03 and 2024-09

there is a similar issue on eclipse.jdt.core for gson

@GedMarc
Copy link

GedMarc commented Oct 1, 2024

That is 100% an eclipse problem,

Also found animal sniffer doesn't like compiles into alternative versions, e.g. jdk11 compiling into versions/17 , throws a java error -
Same issue, the location of /9 is correct as well,
This is internal to eclipse.

@pjfanning
Copy link
Member

jackson-core is a Multi-Release jar - not jackson-databind

I agree with @GedMarc that this does not appear to be an issue in jackson-core/jackson-databind and that issue is in tooling that users are using. @bwzhang2011 provided very little detail on what their issue is.

@cowtowncoder
Copy link
Member

cowtowncoder commented Oct 1, 2024

Not sure if this might be related to a jackson-core fixed issue FasterXML/jackson-core#1340.

Either way description is too incomplete to be actionable; closing. May be re-opened or re-filed with more information; in particular showing how to reproduce the issue.

EDIT: as per @GedMarc that issue appears unrelated to whatever issue was here.

@AndreasWBartels
Copy link

This is a moditect issue moditect/moditect#254

Which unfortunately makes it a jackson issue, because you should either downgrade or upgrade as soon as the issue for moditect is fixed.

@pjfanning
Copy link
Member

moditect/moditect@5d63f7b seems to be in every release since 1.2.0.Final so maybe the best course of action is to downgrade to moditect 1.1.0 in all Jackson repos - 2.18 branches.

https://mvnrepository.com/artifact/org.moditect/moditect/1.1.0

@pjfanning
Copy link
Member

@AndreasWBartels Thanks for the analysis. Moditect is a pretty widely used tool and the commit that you highlight appears to have been in 3 releases of Moditect in the last 6 months. The internet is not ablaze with people complaining about broken jars. My vote would be to use an old version of Moditect until a fix is made - but that there is no reason to rush out a Jackson release.

Users can stick to older Jackson releases if they think they might be affected by this.

@cowtowncoder
Copy link
Member

Uggggh. Moditect downgrade is tricky since if I recall it comes via parent poms. And verification of newer versions, once available, seems difficult.

But if we have to, we have to.

@GedMarc
Copy link

GedMarc commented Oct 2, 2024

I'll update the jdk11 compat test to 2.18, should be able to add a test case there,
Will check on moditect as well

@cowtowncoder
Copy link
Member

Ok. So, if I understand this correctly, the problem reported as moditect/moditect#254 ONLY affects jackson-core and NOT jackson-databind or other Jackson components (or at least not many).

If so, I think the safest patch would be to override plugin version just for jackson-core and not via oss-parent.

Does this make sense? My concern with oss-parent change is mostly that there may be fixes in Moditect (plugin) 1.2 that we'd roll back if downgrading generally.
And also, to a degree, the fact that oss-parent is not well versioned to align with Jackson components so changes should be incremental.

But most importantly: is the issue -- as far as we understand it -- limited to jackson-core only?

@AndreasWBartels
Copy link

AndreasWBartels commented Oct 4, 2024

The problem affects all modules that only add module-info.java, i.e. jackson-databind, jackson-databind-jsr310.

jackson-core adds classes for different versions, which indirectly solves the problem.

$ less jackson-core/2.18.0/jackson-core-2.18.0.jar

5235 Defl:N 2457 53% 2024-09-26 18:41 456dff2e com/fasterxml/jackson/core/util/VersionUtil.class
137 Defl:N 119 13% 2024-09-26 18:41 7bb3a2d5 com/fasterxml/jackson/core/util/package-info.class
0 Defl:N 2 0% 2024-09-26 18:41 00000000 META-INF/maven/
0 Defl:N 2 0% 2024-09-26 18:41 00000000 META-INF/maven/com.fasterxml.jackson.core/
0 Defl:N 2 0% 2024-09-26 18:41 00000000 META-INF/maven/com.fasterxml.jackson.core/jackson-core/
12964 Defl:N 3143 76% 2024-09-26 18:41 d1a50ac1 META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom.xml
74 Defl:N 67 10% 2024-09-26 18:41 20136f0d META-INF/maven/com.fasterxml.jackson.core/jackson-core/pom.properties
_> 0 Defl:N 2 0% 2024-09-26 18:41 00000000 META-INF/versions/
0 Defl:N 2 0% 2024-09-26 18:41 00000000 META-INF/versions/9/
748 Defl:N 291 61% 2024-09-26 18:41 d11640ca META-INF/versions/9/module-info.class
_
1999 Defl:N 747 63% 2024-09-13 12:50 03a7944a META-INF/FastDoubleParser-NOTICE
3047 Defl:N 1424 53% 2024-09-13 12:50 f319319f META-INF/thirdparty-LICENSE
0 Defl:N 2 0% 2024-09-13 12:50 00000000 com/fasterxml/jackson/core/internal/
0 Defl:N 2 0% 2024-09-13 12:50 00000000 com/fasterxml/jackson/core/internal/shaded/
0 Defl:N 2 0% 2024-09-13 12:50 00000000 com/fasterxml/jackson/core/internal/shaded/fdp/

$ less jackson-databind/2.18.0/jackson-databind-2.18.0.jar

18148 Defl:N 7178 60% 2024-09-26 18:56 c00f3bee com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMap.class
150 Defl:N 128 15% 2024-09-26 18:56 602f1aeb com/fasterxml/jackson/databind/util/internal/package-info.class
141 Defl:N 122 14% 2024-09-26 18:56 9962f878 com/fasterxml/jackson/databind/util/package-info.class
21547 Defl:N 5219 76% 2024-09-26 18:56 12ca3bf1 META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml
78 Defl:N 73 6% 2024-09-26 18:56 6fa4ab13 META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.properties
> 1496 Defl:N 487 67% 2024-09-26 18:56 6f852290 META-INF/versions/9/module-info.class


4388303 1477165 66% 827 files

@cowtowncoder
Copy link
Member

@AndreasWBartels ahhhhh. Ok, so the reverse of what I thought. This is... unfortunate to say the least.

In that case, need to consider placement. oss-parent may make sense, then... although jackson-parent could work too (or for most components, jackson-base).

@pjfanning
Copy link
Member

The real fix here is to get Eclipse to fix JDT.

@cowtowncoder
Copy link
Member

I agree wrt @pjfanning 's comment. But in the meantime maybe FasterXML/oss-parent#179 is worth considering.

@bwzhang2011
Copy link
Author

@cowtowncoder why dou you agree the suggestion from @pjfanning, solve the compatibility should be first choice other than adjure eclipse to be adjust to the change between different version of jackson release. and of source it does appear in eclipse enviroment when your project relates to the module-info. so how can I solve it without major modification or wait for next release of jackson ?

@pjfanning
Copy link
Member

pjfanning commented Oct 9, 2024

@bwzhang2011 dozens of jars are published with moditect. Since moditect made its change, lots of them have uptaken the change. The Java command is happy with the jars we publish.

@cowtowncoder
Copy link
Member

@bwzhang2011 Note that the First != Best -- I think Eclipse fixing tooling would be the BEST fix (assuming I understand the issue correctly). It might not be the FIRST thing we do -- we may well need to use a work-around like downgrade.

@cowtowncoder
Copy link
Member

Ok: so, Moditect plugin version is downgraded to 1.1.0 for Jackson 2.18 branch, and I verified that resulting jar/bundle now has intermediate directory entries.
Fix was actually via:

FasterXML/jackson-parent#15

but I'll mark this as fixed in release notes as well.

Changes will be seen in 2.18.1 release.

I hope there will be a new Moditect release at some point so we can upgrade to the latest, but for now I hope this does the trick.

@cowtowncoder cowtowncoder changed the title module-info class lost during 2.18 version emodule-info class lost during 2.18 version on Eclipse Oct 13, 2024
@cowtowncoder cowtowncoder changed the title emodule-info class lost during 2.18 version on Eclipse Eclipse having issues duemodule-info class "lost" on 2.18.0 jars Oct 13, 2024
@cowtowncoder cowtowncoder removed the to-evaluate Issue that has been received but not yet evaluated label Oct 13, 2024
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

5 participants