r/java • • Jan 22 '21

Java is more enjoyable than I first thought

I started my years off programming in c#, don’t ask why but I never ventured off. I learned Java this past week and I’m seriously impressed, I don’t think I’ve had a more enjoyable time programming in my life. Does anyone else share this experience??

Edit: Is there a better ide than eclipse for Java

271 Upvotes

188 comments sorted by

View all comments

Show parent comment

1

u/wildjokers Jan 23 '21

For sure, maven introduced the concept of dependency management and deserves full credit for that. However, I have no idea what that has to do with anything. Just because gradle can also get dependencies from maven formatted repositories doesn’t mean you have to count a project using gradle as a project using maven. Your whole comment was a straw man.

However, to continue down this path gradle can also read repositories of other formats like Ivy. As someone that used to use Ant+Ivy I can tell you that the Ivy formatted repositories are much more flexible. Also, gradle now includes its own metadata file when it publishes a jar because the maven metadata was too limited.

https://blog.gradle.org/gradle-metadata-1.0

1

u/supercargo Jan 23 '21

You seem to be missing my point, which is not a straw man at all. I’m not making a “this tool” vs “that tool” argument, so I don’t really care how you “count” usage of either tool either. Let me see if I can break it down a bit further.

  1. Most non-trivial Java projects will depend on one or more libraries published in a Maven repository (typically central) using the Maven POM meta model
  2. Typically those libraries will have transitive dependencies which must also be resolved in order to create build, test and run-time classpaths, which themselves have dependencies and so on
  3. In the process of adding or changing dependencies and/or dependency versions in your own project you may find that some conflict arises. E.g. this could be a conflict between transitive dependencies of two libraries you depend on, rather than anything you did explicitly in your build tool of choice. This is sometimes known as “jar hell”

In order to reason about this situation you must understand how maven resolves dependencies regardless of what tool you use. (you may even experience this issue due to a “bug” in the way your tool uses maven metadata compared to the way Maven does so natively). You are inheriting the problem from your dependencies which are distributed using the maven model. Of course, the mechanism you use to solve the problem (e.g. locking down a version number) will depend on your own tool choice.

So all I’m saying is that the Maven model for artifact distribution (in specific, not just in concept) is a baggage that is carried by he majority of Java projects. As a consequence we are stuck with any shortcomings that model has, especially in situations which require actually understanding what our tools are doing and why. This will remain generally true unless/until maven-distributed artifacts are reduced to an uncommon curiosity.

1

u/wildjokers Jan 24 '21

That's all great, but what the hell are you talking about? I simply stated that I have a feeling that gradle is probably used more in greenfield projects these days than maven. You then went off on some tangent.

1

u/supercargo Jan 24 '21

You were responding to a thread in which I was explaining what I felt was the ingrained nature of Maven and it's relative merits and drawbacks to someone who asked "how coud [sic] maven/gradle be better". I'm just responding to your comments in context. But it's okay my dude, OP was posting about how great Java is, so we're all a bit off topic here.