Open bwzhang2011 opened 1 week ago
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
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
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.
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.
Not sure if this might be related to a jackson-core fixed issue https://github.com/FasterXML/jackson-core/issues/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.
This is a moditect issue https://github.com/moditect/moditect/issues/254
Which unfortunately makes it a jackson issue, because you should either downgrade or upgrade as soon as the issue for moditect is fixed.
https://github.com/moditect/moditect/commit/5d63f7bfce19dbf9d17fa122a758ac2e88f93e6f 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
@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.
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.
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
Ok. So, if I understand this correctly, the problem reported as https://github.com/moditect/moditect/issues/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?
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
@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
).
The real fix here is to get Eclipse to fix JDT.
I agree wrt @pjfanning 's comment. But in the meantime maybe https://github.com/FasterXML/oss-parent/pull/179 is worth considering.
Search before asking
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
<-- Any of the following
Expected behavior
no error while import module class support
Additional context
No response