20 ms·
Depends on what you call "decently". Maven and Gradle do the job, but the bigger problem is the ecosystem: Libraries don't declare version ranges for their tra
by Tainnor 3y ago
Depends on what you call "decently". Maven and Gradle do the job, but the bigger problem is the ecosystem:
Libraries don't declare version ranges for their transitive dependencies (like they do e.g. in Ruby), instead they just depend on a specific version. Of course, because two different libraries may depend on the same subdependency but in different versions, you will just get one version and you have no way of knowing whether it will work correctly.
That isn't a problem in 90% of cases, but sometimes it is and you'll notice it when you're suddenly getting ClassNotFound exceptions.
There are some solutions to this, e.g. bigger frameworks like Spring publish BOMs, which are just sets of library versions known to work together, but they don't cover everything.
- dkarl 3y ago> Libraries don't declare version ranges for their transitive dependencies That's the behavior that Maven itself recommends, so Maven is at least part of the problem. Maven could also sanity-check your build for these issues by default, but it doesn't; it leaves that up to plugins, which you have to configure (in XML) in your build file every time you set up a new project.
- tadfisher 3y agoYou can depend on version ranges with Gradle, and those ranges are transitive if the library is also using Gradle; otherwise, you can override a library's transitive dependencies pretty easily with component metadata rules. You can do so much with Gradle, but 90% of learning it is figuring out what knobs you need to twist; there's a lot of feature overlap and second-system-effect going on.