-
Notifications
You must be signed in to change notification settings - Fork 161
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
Honor Maven repositories specified in .m2/settings.xml #1928
Comments
Sorry for dragging you into this issue @cstamas :-) (Their script uses |
@quintesse See here: For some reason JBang opts to REPLACE user settings.xml reposes with own "partials". |
@cstamas look at the "blame" on those lines ;-) But I'm guessing you implemented that to reproduce what we were already doing before. Thing is, I think what we were trying to do is to replace any defaults (so you can say that you do not want central, by not including it in your list of repos), but not so much any user-defined ones. Is there a way to do that with MIMA right now? So being able to override Maven defaults but leaving anything in settings.xml alone? We'd then have to see if that is something we want to enable, because I think the reason we did it this way was to make sure that the results of a resolve are always predictable. Which might mean that we'd need a special option that the user could add to indicate that they want JBang to pick up on the settings.xml repos. (Not sure I'm very fond of that idea, but it's an option) |
MIMA by default will add Central only. Then, if context override is built with So one thing you could do is create a context to get "user env" related to |
Yeah, it's somewhat clear. But wouldn't that temporary context also include the default Central one? If so, we'd have to ignore that one, and merge the remining ones with the ones JBang wants to add. |
Sure. Just one tiny detail re differences between Maven3 and Maven4:
In short: Maven3 must have Central added "to start from somewhere" (otherwise by def env has no remote repositories defined, unless user have some in user settings.xml), while Maven4 by def have Central in "root" (unless installation settings modified). |
Ok, thanks for the explanation! 👍 |
A) I dont understand the issue in camel jira. Sounds like camel-jbang changed some behavior ? B) we don't (and someone has to explain why we should) default honor .m2/settings.xml same reason gradle doesn't. Your local maven setup shouldn't affect jbang execution. That's why we default to include central, but if you specify any other repos we expect you to specify all of them. You can use multiple --repos to add any combo - why is that not working with camel-jbang? Could we honor .m2/settings.xml somewhow ? Maybe - but it would have to be some explicit flag or env variable. Can't/shouldn't be the default IMO. Don't we honor some .m2/settings.xml ? Yes, we do get matching security creds if the same id is in .m2/settings.XML. But it's also not default - you have to align the repo name/urls. |
Is your feature request related to a problem? Please describe.
Currently the Maven repositories specified in the .m2/settings.xml are not picked up to resolve dependencies
Describe the solution you'd like
Honor Maven repositories specified in .m2/settings.xml
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
When using a JBang application, it might not be possible to specify the Maven repository.
Specific case here: due to https://issues.apache.org/jira/browse/CAMEL-21283 , there is no way to use the specific 4.8.0.redhat-xxx version for soem commands
Steps to reproduce:
edit .m2/settings.xml, to add:
jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel init 'demo.camel.yaml'
jbang '-Dcamel.jbang.version=4.8.1' --verbose camel@apache/camel run 'demo.camel.yaml' --dev --logging-level=info --camel-version=4.8.0.redhat-00017 --local-kamelet-dir=.
The text was updated successfully, but these errors were encountered: