jbang icon indicating copy to clipboard operation
jbang copied to clipboard

jbang search or jbang deps ?

Open maxandersen opened this issue 4 months ago • 6 comments

would be interesting to combine gavsearch@jbangdev and jpm search feature to allow easy lookup and edit of deps..

ideas:

jbang dep add --deps org.hibernate:hibernate-core:4.7.8 myapp.java would directly add that dependency to myapp.java jbang dep add --deps hibernate myapp.java would search for 'hibernate' artifacts (as 'hibernate' in it self in maven central and let you pick/choose artifacts to then get added/updated in myapp.java

even imagine jbang dep add --deps hibernate,log4j myapp.java would be two searches...one for hibernate and log4j would "constrain"/guide the search for log4j....could even parse/read myapp.java to know what is referring to.

maxandersen avatar Aug 19 '25 14:08 maxandersen

if anything this feels like a prime candidate for being a jbang plugin and not default included. wdyt @quintesse ?

maxandersen avatar Aug 19 '25 14:08 maxandersen

btw. remember jbang run has defaults it searches for when no arguments(i.e. main.java, jbang.build..) jbang dep/search could have the same.

maxandersen avatar Aug 19 '25 14:08 maxandersen

jbang deps update could incorporate #2148 deps@jbangdev

maxandersen avatar Aug 19 '25 15:08 maxandersen

Yeah, definitely think this could be a plugin. The only thing I can think if that could cause a bit of duplication of code is the part where you say (correctly): "remember jbang run has defaults it searches for when no arguments(i.e. main.java, jbang.build..) " Because it means that lookup of default files would have to be duplicated in the plugin and might at some point get out of sync with jbang itself. Not sure if that's something we really have to worry about but I thought I'd at least mention it.

quintesse avatar Aug 19 '25 22:08 quintesse

These are reasons to extract those core logic as library.

that said it also feels like something like deps mgmt is a core feature so let's see how it looks like :)

maxandersen avatar Aug 20 '25 05:08 maxandersen

These are reasons to extract those core logic as library.

Definitely

quintesse avatar Aug 20 '25 08:08 quintesse