-
Notifications
You must be signed in to change notification settings - Fork 8
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
[ERROR] Could not read artifact descriptor for dev.enola:enola:jar:0.0.1-SNAPSHOT #1040
Comments
This is a pretty ugly hack, but could do, for now:
I cannot seem to reproduce this, it appears to work with both:
|
Ah no, I now actually CAN reproduce it, like this:
Perhaps the Maven resolution in JBang 0.123.0 just got stricter than it used to be in 0.122.0... but I guess the |
does not work - which perhaps isn't too shocking, because I "made up" (just tried) |
maxandersen/jbang@8af7329 for jbangdev/jbang#431 appears to have introduced a |
Would it be possible to run jbang with --verbose to see what the actual error is? |
Merging #1042 "fixed" (worked around) the problem for this project for the short term. I'm keeping this issue open to follow-up later for both jbangdev/jbang#431 & jbangdev/jbang#1921. |
@quintesse sure thing:
That's actually quite interesting - Thank You for suggesting
means that a dependency of The Maven dependency resolution definitely changed from JBang 0.122.0 to 0.123.0. Looking at java-multihash:v1.3.4/pom.xml, it uses Next logical step here would probably be to fix those missing versions, with an upstream PR, and while awaiting that, JitPack from fork. (I love not depending on having to wait for projects releasing versions to Maven Central!) Thank You again for having suggested |
No, I'm just tired, these versions ARE defined (here). So it seems that the Maven dependency resolution changed from JBang 0.122.0 to 0.123.0 to cause the problem above, according to @quintesse due to jbangdev/jbang#1901 by @cstamas. /CC @maxandersen
Next Step: I'm going to give the JBang maintainers time to look further into this, and not actively further pursue this in this project. |
I don't quite follow: you installed this pom (copy pasted from your comment) and then JBang invocation fails. I cannot reproduce as I cannot even build the Maven project (a lot of compilation errors), but what strikes me, is that the POM you installed is Can you please post simple reproducer steps? |
In other words, I did:
|
In fact, given this tree output: https://gist.github.com/cstamas/9978178bb3072c04a34cc9b8d7dfbfef |
Finally, I'd really like to see the contents of |
@cstamas Thank You for your interest in reproducing this! Very sorry for the confusion, but it's like this:
... this project does not actually use Maven to build, but another build tool (Bazel). As https://docs.enola.dev/dev/jbang/ documents, the But it may be a PITA to get this working locally for you (the documentation could be out of date; I'm working on fully adopting Development Containers, only), so unless you really want to build this project yourself (do feel free to file bugs for anything that's not working as documented), do read on!
FYI that's because that It's actually this which builds the Maven POM. I've now added some clarifications related to this.
This has motivated me to pick up #970: Voilà: https://docs.enola.dev/maven-repo/dev/enola/enola/0.0.1-SNAPSHOT/enola-0.0.1-SNAPSHOT.pom
You can (now) easily reproduce the problem that this issue is about like this; see how this works: $ git clone https://github.com/enola-dev/enola.git
$ cd enola/learn/jbang
$ rm -rf ~/.jbang/ && JBANG_DOWNLOAD_VERSION=0.122.0 ./jbang hello.java but how this fails, with the error shown above earlier: $ rm -rf ~/.jbang/ && JBANG_DOWNLOAD_VERSION=0.123.0 ./jbang --verbose hello.java |
Howdy, I tried devenv, but https://gist.github.com/cstamas/126b819e3b70dbf75e64946119fd5478 |
Ok, I got it reproduced. |
Got it, your pom:
Has mixed version w/ type. So, JBang (Maven Resolver) is right. |
@cstamas OMG! Thank You for having pinned this down to that. I've had a closer look (notes just for the memory of my own future self):
It seems to me that there really are sort of 2 problems and "upstream issues" here, which I will separate file, next: A. B. Bazel's @cstamas let me know if, with your Maven foo background & experience, you agree with this analysis? |
Re Maven versions: do not look at maven-artifact Versions, they are deprecated. Spec is fleshed out in package-info.java
A: So "v1.3.4" is completely okay version as Maven goes. |
And the reason for this issue: JBang before 0.123.0 was "forgiving" re dependencies, as can be seen, it was happy to just skip non existing dependency. Starting with 0.123.0 it got more strict, and will fail if your dependencies are invalid. One interesting thing that confused me in start: the error message emitted by Resolver: "''dependencies.dependency.version' for com.github.multiformats:java-multihash:v1.3.4 is missing." was very misleading, but what happens in reality, is that Resolver shows us GAE (groupId, artifactId, extension!), but as we see version (we "know" v1.3.4 is a version) this error makes no sense. Resolver could improve this message, as all would be clear from beginning if message would be something like "'dependencies.dependency.version' for G=com.github.multiformats; A=java-multihash; E=v1.3.4 is missing." |
Related to enola-dev/enola#1040. See multiformats/java-multihash#48 for multiformats/java-multihash#47. @ianopolous merge this after that?
If this has motivated you to contribute an improvement for this to, go for it! Do you want me to e.g. file an
multiformats/java-multihash#48 for multiformats/java-multihash#47, merge into fork at https://github.com/vorburger/java-multihash/tree/vorburger, now available as
I'll attempt to switch this project (Enola) to using that, to confirm that it's really (Bazel's) |
Oh, and one more thing: JitPack: So personally I'd recommended to avoid it in your tooling. Better use private repo, like that of GH or even on site as you did. |
Sure, all issues (and PRs) are welcome! |
https://issues.apache.org/jira/browse/MRESOLVER-673
Today JitPack is the best way that I know of for how to depend on some random Java libraries from GitHub which are not or not yet released to Maven Central. Or to depend (on fixed versions of, using SHA as "version") libraries which were released, but that I had to patch - instead of having to wait for maintainers to accept patch, release new versions... that model inherently by definition just does not scale. And setting up a repo like on GH is just "not worth it" for such cases. If you know of a better way how to do this, then let me know! In the meantime I'll keep using JitPack - even though it's not perfect, sure (I don't disagree with some of the criticisms from that blog post.) But one fine day (probably next not this century) I'll build an alternative; watch #1063! LoL. 😆 |
Blocked by bazel-contrib/rules_jvm_external#1324. Documented with https://github.com/enola-dev/enola/pull/1064/files for my future self. Enough of this! 🙄 Pausing further work here, until |
Recent PRs, including my "manual" #1039 as well as all dependabot & renovate PRs in the last 5 days, fail due to:
This used to work just fine, until a few days ago.
@maxandersen my hunch here is that https://github.com/jbangdev/jbang/releases/tag/v0.123.0 might be the culprit which broke this, somehow; and v0.122.0 from Dec 16, 2024 still worked... but for now that's just that, a hunch. I'll try to see if I can reliably reproduce this, before & after, and if so, update here.
PS: There is actually really 2 separate issues here:
(a) the fact that JBang is an "unstable" build time dependency of this project - I don't want ANYTHING external to EVER "just change by itself" (and I'm doing this by fixing versions for many other tools) - so one part of resolving this problem is to "pin" the JBang, somehow... @maxandersen any suggestions for how folks do this is very welcome! Maybe it would be cool if there was a
.jbangversion
tag file?(b) fixing the actual problem
The text was updated successfully, but these errors were encountered: