I have taken a long break from Java. Back in the day if you wanted to use a library you added the jar onto your class path and off you went. Now there's maven, and gradle, and I don't get it? Am I supposed to edit this xml to tell my build how to find external resources? Is there a tool that does this for me like pip install or something? Or do I need to learn one or both of these things?
#Maven Gradle??
1 messages Β· Page 1 of 1 (latest)
<@&987246554085740594> please have a look, thanks.
Here is an AI assisted attempt to answer your question π€. Maybe it helps! In any case, a human is on the way π. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
et it. Can someone explain the difference between Maven and Gradle and why I should use one over the other?
yeah u just tell it the "name" of the dep u want to add by putting it into the gradle.build file or the maven pom.xml
by default its supposed to look at ur local cache folder and at maven-central (some kind of official website to upload stuff to)
but u can also add other sites
jitpack is another important site, as it allows to automatically add anything from github directly
okay so it's pulling those resources from the internet
thats pretty awesome
its ofc not as convenient as pip
but it goes in the same direction
and its also more than just for downloading deps
it can also automate other build steps
eh whatever so long as I can figure it out. I saw this pom.xml thing and had some quick WTF's
such as "whenever i compile, i want u to do create javadoc, upload it to here, create a jar, upload it to there, do this and that and ..."
yeah all in one
decent thanks
yeah, if you are brave you can use this tool that I made
I'm kind of brave but, usually when someone says something like that it means I'm in for a ride
you tell it the dependencies you want and it spits out a classpath
(psst, use gradle, you write 5x more on maven for the same thing usually)
it looks more complicated but I'm sure once I figure it out it'll be fine
$ jresolve pkg:maven/org.apache.commons/[email protected]
/Users/emccue/.jresolve/cache/https/repo1.maven.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar:/Users/emccue/.jresolve/cache/https/repo1.maven.org/maven2/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar:/Users/emccue/.jresolve/cache/https/repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar:/Users/emccue/.jresolve/cache/https/repo1.maven.org/maven2/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar
$ jresolve --output-directory libs pkg:maven/org.apache.commons/[email protected]
yeah you'll be fine with just maven
oh 100%, but i crave volunteers
and I do think this is closer to what you remember, if you liked that
yea I used to be a fan of it
I will consider trying it after I get the hang of one of these other ones
seperately since you mentioned make - take a look at https://github.com/casey/just
(nah use maven, better)
thats just a command running thing, pretty generic and not java specific
why is gradle or maven better not trying to start a battle but, if there's a substantial difference I'd like to know
world war 3 incoming
Opinionless description:
I'll let Ethan do the talking
Maven is a "plugin execution engine"
you have an XML file and a set of tasks like mvn compile mvn test, etc.
Maven is way more used, and is simple and verbose by design
Gradle has deamon for faster consecutive runs, shorter syntax and has a scripting language
and when you run those, different plugins run
you can do any amount of logic within a plugin, but if you don't write a plugin yourself maven is generally inflexible
this is seen as a pro, since it means that it is harder to do exotic, wierd things
gradle is also a "plugin execution engine"
but you interface with it from a general purpose programming language (kotlin or groovy)
and it is easy to do any amount of logic, so gradle is very flexible
this is seen as a pro for the opposite reason you would like maven's inflexibility
so build scripts can contain a bunch of logic, but now there is a much higher chance that you mess it up
interesting. it does seem like gradle has a lot more complexity, and if I'm trying to get my head around this for now I'd probably pick maven then
I want to learn groovy but not by failing to get packages to run π
Kotlin is probably more preferred because it's more "modern"
kotlin is used more as a JVM language than any other language (except of course, java which is obviously still more used than any other known JVM language easily)
doesn't mean you can't learn it, just saying kotlin could be a better scripting language or a better language in general π
maybe go for maven and don't worry about all of this for now
thanks for the advice, yea maybe I will check out kotlin then
when it comes to JVM langauges, should I bother picking up Java or just ride along with Kotlin? I like having Scala as a side kick but so much has changed
Well here are the "serious" jvm languages i know of
Java, Scala, Kotlin, Clojure, JRuby, Groovy
Groovy is a dead zone
no longer a java superset, mostly kept afloat by gradle
JRuby is its own universe. If you like ruby and the ruby world its there
Clojure is a lisp. It has an active community but it will always be small. I like it and had a job in it for 3 years but it is a niche pick
ah yea I remember reading about clojure. Lisps are great but they have that curse in that they never get adopted π¦
Scala was "Java++" in 2007, but now most of the really useful features from it are in Java or coming shortly
these days its mostly typed FP zealots obsessed with monads
and they have a Python2 -> 3 like thing going on with Scala 3
Kotlin is today's "Java++", but it also is cursed in that all of the really useful parts of it are in Java or coming in the future
interesting, so maybe its more of a question of kotlin and java than anything else. Oh yea I remember some of that FP idealism back when I used it, I only liked it because it let me write cleaner Java. Which pissed off serious scala people to no end, but it was useful to me at the time
I see so Java is taking the C++ approach to language development
and its bad features are gonna be around forever - like it has suspend fns for async/await when the runtime on the JDK doesn't need that anymore
so kotlin is now the king of android, but on the JVM its sorta...worse java
there are cool things, like it has null types in the type system
but even that is coming to Java in some form
(eventually)
so if you are making an android app or just something for fun - yeah kotlin is great
but it never really pulled me in, personally
I take it java applets are dead too now that JS is ruler of all web things?
these docs have kotlin and java samples
yes, java applets are dead and set to be removed from the language
yea basically zero difference
wow well thanks for filling me in, its kind of hilarious
everything just went back to Java
Wasm π
rust compiles to wasm ;)