-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Gradle module metadata for 2.13.2.1 references non-existent jackson-bom 2.13.2.1 #3428
Comments
The easiest fix would be to publish a 2.13.2.1 BOM (which, IMHO should be done in any case). Depending on your situation, you can:
dependencies {
components {
withModule("com.fasterxml.jackson.core:jackson-databind") {
allVariants {
withDependencies {
removeAll {
it.name == "jackson-bom"
}
}
}
}
}
}
dependencies {
constraints {
api('com.fasterxml.jackson:jackson-bom') {
version {
strictly '[2.13.2, 2.13.3['
prefer '2.13.2'
reject '2.13.2.1'
}
because 'Jackson Databind references non existent BOM'
}
}
} This, however, if published, would always prevent from getting |
Unfortunately 2.13.2.1 bom is not practical for the reason that there is no consistent set of all jars; only I hope above makes sense wrt what this scheme tries to accomplish. I realize it is not necessarily compatible with expectations of other tooling that tries to make sense of structure. On plus side once there are enough other fixes there will be |
I understand your perspective but the way that tools, particularly for CVEs work, you should just follow a pattern where these micro releases trigger a full build for each patch. This 2.13.2.1 would have contained this fix and the next one would generate 2.13.2.2 and so on. Having artifacts with dates at the end causes chaos. |
@laffer1 That may be how other projects work but this is not the way Jackson works or (IMO of course) should work. The trade-off is as follows: releasing a full set of versions for ~20 components from about dozen repositories takes multiple hours. I will not do this for ONE SINGLE change in ONE COMPONENT. Full sets are released when there are enough things to release. But sometimes community wants a hot-fix; either for otherwise closed branch, or, less commonly, due to timing from an open branch. In these cases I can do a patch version of just that one component. This is quicker to do. And I could leave it at that: let everything use existing patch-version
so it is always clear which version of From user perspective I do not see an actual problem: they select the latest I do realize that some specific tooling -- like Gradle -- might have some other assumptions, and I am happy to try to work with others to alleviate the problems. But what I do not think is reasonable to ask is that one would not have differing version numbers in components included in a BOM: after all this is what version sets are all about! If every component everywhere had just one globally synchronized version number we wouldn't need BOMs (or version dependency management systems). Of course if this is all too complicated, I could just stop releasing |
We can argue whether Jackson should be released as a unit or not, we can argue about the versioning scheme, but this is orthogonal to this issue. The problem to be fixed is that there's wrong published metadata, which is harmful. There is a module file which references a non-existent BOM. Currently it makes things fail, but if the BOM was published, then it would start "working". So to me, either a new version of There are no particular assumptions made by Gradle, it's quite flexible. The only requirement is to have correct metadata. When wrong metadata is encountered, there are ways to workaround this (fix metadata via rules), but unfortunately, this wouldn't propagate to consumers. We should also think about ways to prevent this from happening in the future. I don't know the jackson release process enough to help there, but for Micronaut (which uses Gradle) we implemented for example a "BOM checker" which would guarantee that you don't publish a BOM referencing non existent dependencies. Something similar could be implemented to verify that a library doesn't reference non existent dependencies (including BOMs). However I think it wouldn't be as easy to do with Maven. |
Sorry, I don't have time right now to get into the whole conversation here. I think whether or not the versioning would be changed in the future, at first the metadata publishing for the current versioning approach should be fixed. I think this this is the right solution: |
The metadata is flat out wrong. That needs to be addressed. As for the difficulty in releasing components, that sounds like a problem that can be solved with an automated pipeline and versioning. |
@laffer1 I agree that Gradle metadata issue should be resolved (I assume this is the crux of the matter). But I see no reason or benefit from changing Jackson's versioning itself, with respect to micro patches (hot fixes), nor have any plans for changes in this area. It just makes no sense to release dozens of jars for a single change in a single jar, no matter how things are automated (nor can automation typically resolve the problem of release notes etc etc etc). That said, choice of version number for special BOMs (or possibly avoiding releasing them) is something I would consider. To me choices look like:
I added (4) as the most likely choice after realizing that
So far I had tried to make both use cases work the same (... for 2.x) but now that I think about it, approach (4) would separate use cases for case of micro patches. It seems to me this might be the way to avoid problems with metadata. |
@melix (and @laffer1) I agree wrt metadata: it should NOT refer to non-existing BOM. That we are in agreement on. I added another note on FasterXML/jackson-bom#52 as well and I wonder if path forward would be what I propose there (which is same as what I added as option (4) for my comment above). |
I think I know how to fix the immediate parent-pom-version-wrong problem, but have one final concern on whether
It would be great if someone could see whether dependency to |
Thanks a lot @cowtowncoder and sorry for causing this trouble by missing this particular "micro version" detail when we first introduced Gradle Metadata to Jackson. I tested with
(The |
Thank you @jjohannes! It's more my fault wrt micro releases really as I knew about this case but did not think it through or ask questions. But at least we are solving the issue now I think; and can have both immediate improvements and longer term maintainable choices. And so it looks like |
Is it fixed on 2.13.2.1 ? I am still getting error Could not find com.fasterxml.jackson:jackson-bom:2.13.2.1 |
This does not seem to work with maven or perhaps I am missing something I am using
But then I can't define it as :
Because Maven expects a version
At the same time, I can't use the bom version because they do not align as before I could define two separate properties to manage the versions but that defeats the purpose of using the bom In See https://github.com/reactiverse/vertx-maven-plugin/pull/391/files for an example
edit : Never mind. The issue is that BOMs need to be imported under |
Individual libs in Jackson don't necessarily all get released at the same time. The BOM is the right way to ensure versions are all on latest. In this case, to get a CVE patched within databind. See FasterXML/jackson-databind#3428 for more detail
Individual libs in Jackson don't necessarily all get released at the same time. The BOM is the right way to ensure versions are all on latest. In this case, to get a CVE patched within databind. See FasterXML/jackson-databind#3428 for more detail
Individual libs in Jackson don't necessarily all get released at the same time. The BOM is the right way to ensure versions are all on latest. In this case, to get a CVE patched within databind. See FasterXML/jackson-databind#3428 for more detail
This is great and all... but none of this works if a Gradle user has turned on I believe there are two outstanding issues here:
I'm wondering if the 'correct' solution here is to remove the BOM from the POM hierarchy. At that point you have the ultimate parent POM capture the compatibility rules for the versions, and then an independent BOM catalog collect a specific set of artifacts that satisfy those rules? |
@chrisdennis I tried to ask about whether this would be problematic but understood @jjohannes suggested things are fine. I think my question was too specific on one aspect of conflicts. I agree that it seems that some aspect of version ranges would be useful; but I have no idea how to make that work, and version ranges in, say, Maven dependencies, are widely considered to be problematic (wrt repeatable builds for example). Now; I am not sure how to proceed. Issue specifically affects component(s) with micro-patch: here
Doing (1) would provide better set for |
If this is possible with your release/versioning process, it would be the best solution. Then there would be no "conflict" , |
@jjohannes This is how 2.13.2.1 would have worked, if the generation had used Maven parent pom version (instead of project version). I can definitely go back to doing that, instead of older minor-version bom. Not sure how big a problem the use of "last patch version BOM" is for 2.12.6.1 / 2.13.2.1 / 2.13.2.2. |
@cowtowncoder that sounds good. I would do it like that for the next micro-patch releases then. To reiterate: The important bit is that the version of the component that references the a timestamp BOM is the same version that the timestamp BOM references back of that component. Then there won't be this "internal conflict". The issue only occurs if users use the But of course, I should not make assumptions about all users. So thank you @chrisdennis for bringing this up.
I think it is not a big problem. Users who use |
Ok thank you @jjohannes. This makes sense. I will then follow the original procedure, now that generation of GMM has been fixed to use parent pom reference (as well as allow optional override if need be). |
From my point-of-view this is "solved" in that I can work around it. The working around is a little un-orthodox but it works. I'm having to do a combination of component metadata rules to decouple the Jackson modules from the BOM version restrictions, and a dependency substitution on the This isn't really the place for a discussion of the relative merits of the "optimistic version upgrades" versus "manual conflict resolution" when resolving a dependency graph, so I'll leave that discussion in the Gradle Slack. |
Wow, what a mess... I can't believe you considered this as closed, since "jackson-bom:2.13.2.1" is totally broken as part of this discussion. |
If you have something to add here, it would be wonderful if you would describe the issue you are having with instructions on how to reproduce it. The problems known so far, and their solutions, are discussed and described above. A comment like:
Is not an accurate description of a problem. You might want to reconsider how you communicate - in general, but also in particular on an issue tracker of an open source project that is maintained by a single person in their free time. The underlying issue is solved. Upcoming Jackson releases won't run into this again. That's why the issue is closed. As said above: Already published components/metadata cannot be changed. |
Fair enough. So, my issue is that when simply using "jackson-bom:2.13.2.1" (a released version that is listed here: https://search.maven.org/artifact/com.fasterxml.jackson/jackson-bom), the related dependencies all fail, since there are no releases for almost any of the jackson components that match the "2.13.2.1" version. Do keep in mind that I am not complaining about trying to use jackson-databin 2.13.2.1, but rather that this discussion led the bom into a really poor direction, while only fixing "exactly" jackson-databind and nothing else. |
I think the combination jackson-bom 2.13.2 and jackson-databind 2.13.2.2 should work fine right now. It's what we use with micronaut. The bom will be fixed in the next release. |
@blaghed I am not sure why you think I do not quite understand this part: this discussion led the bom into a really poor direction, while only fixing "exactly" jackson-databind and nothing else. partly because there was nothing else that could be fixed in retrospect about Having said that, use of https://mvnrepository.com/artifact/com.fasterxml.jackson/jackson-bom/2.13.2.20220328 (which points to is still recommended. |
Just one last note: there now actually is https://mvnrepository.com/artifact/com.fasterxml.jackson/jackson-bom/2.13.2.1 so the issue of dangling reference should be resolved. |
See FasterXML/jackson-databind#3428 for why the BOM version has a date suffix.
See FasterXML/jackson-databind#3428 for why the BOM version has a date suffix.
See FasterXML/jackson-databind#3428 for why the BOM version has a date suffix.
Describe the bug
See:
https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.13.2.1/jackson-databind-2.13.2.1.module
The Gradle module metadata for the 2.13.2.1 release contains:
The
jackson-bom
version that should be resolved (viajackson-base
) is2.13.2.20220324
. Everything is fine consuming jackson-databind from Maven, but from Gradle it is currently broken in 2.13.2.1 due to this wrong metadata which causes Gradle to try and fail to resolvejackson-bom:2.13.2.1
as seen in this error:This can also be seen in this failed build scan.
Version information
Which Jackson version(s) was this for? 2.13.2.1
To Reproduce
If you have a way to reproduce this with:
Add a dependency on
jackson-databind
version 2.13.2.1 in a Gradle build and build the project. E.g.dependencies { implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.2.1' }
Expected behavior
If reproduction itself needs further explanation, you may also add more details here.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: