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

fix: if no deps, avoid npe; also make sure POMs refd exist #1901

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

cstamas
Copy link
Contributor

@cstamas cstamas commented Jan 10, 2025

If there are no deps (or only imports, which does not make sense), do not belly up. Also, make sure that all the refd POMs (of deps and imports) are present, as by def Maven uses "forgiving" policy.

@cstamas cstamas changed the title bug: if no deps, aboid npe bug: if no deps, avoid npe Jan 10, 2025
@cstamas cstamas changed the title bug: if no deps, avoid npe bug: if no deps, avoid npe and make sure ref POMs are present Jan 10, 2025
@cstamas cstamas changed the title bug: if no deps, avoid npe and make sure ref POMs are present fix: if no deps, avoid npe; also make sure POMs refd exist Jan 10, 2025
@quintesse
Copy link
Contributor

The strict resolving seems to break some tests, right?

Like versionless artifact was sent to load POM for, while
this now fails (before it was just silent about it due
forgiving policy)
@cstamas
Copy link
Contributor Author

cstamas commented Jan 10, 2025

Even if now it works, this is wrong. The deps with ranges should be first "materialized" as exact versions, as nothing guarantees that you load POM of v1 and then resolve v2 (this is very bent example, but still, no guarantee for it). Or in other words, now the range is resolved twice: once to get POM (to get depMgt from it) and once during collection.

This format is really really weird...
@maxandersen
Copy link
Collaborator

sorry for being daft here - whats the wrong part? afaik we didn't do anything different with version ranges than normal maven...but you write as if we did - so curius to grok it before merging?

@cstamas
Copy link
Contributor Author

cstamas commented Jan 16, 2025

no problem per se, feel free to merge. It is only me tinkering...
For me the wrong part is that ranges are resolved twice (which in a session will yield same result UNLESS jbang equiv of mvn -U (--fresh?) is used AND a deploy happened between the two invocations -- which is a very small window, but is not zero).

All in all, is fine to merge, but needs more. Will add PR later.

@maxandersen maxandersen merged commit f603f8b into jbangdev:main Jan 16, 2025
10 checks passed
@quintesse
Copy link
Contributor

@cstamas it seems these changes have caused issues with some of our users. Could you perhaps take a look at this issue and see what's going on? enola-dev/enola#1040

@cstamas
Copy link
Contributor Author

cstamas commented Feb 6, 2025

I don't think so. In fact, i think these changes made some issues in projects apparent, that were hidden before... We will see...

@cstamas
Copy link
Contributor Author

cstamas commented Feb 8, 2025

So I was right 😄
JBang discovered an issue bazel-contrib/rules_jvm_external#1324

@quintesse
Copy link
Contributor

Awesome! :-)

I don't understand though how it worked in JBang version 0.122.0? Does that have to do with the "lax resolver" PR you opened? If so I would love if you could explain the "how" to me, because it's a mystery to me 😅

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

Successfully merging this pull request may close these issues.

3 participants