Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The reason is that a sane format for dependencies (i.e. not XML) would be something like:

    "dependency-x": "1.0"
    "dependency-y": "3.2.1"
This is basically what Cargo.toml, package.json, even requirements.txt give you.

Compare that to the 6 lines minimum that each maven dependency is, plus the fact that you sometimes need to specify the same dependency again in the <dependencyManagement> section for what other languages's tools do with lockfiles, which could be several pages away because of the aforementioned bloat. So it ends up being a pain to find the version information, and to update it.

Then you add in the multi-module dependencies, where you're supposed to keep the versions in sync. Sure, there's parent POMs to help with this, but you can only use one at a time, and ultimately someone still needs to maintain the parent POM.

So then rather than specify the same version number 8 or so times in very distant locations, people put a bunch of properties with version numbers to simulate a less clunky dependency specification format.



You don't have to define the version multiple times. If you've specified it in dependencyManagement, you don't have to add a <version> under <dependencies>. If you do it in the parent POM, you won't have to specify versions in the child POMs either.

The only time you have to repeat the versions of dependencies is when there are related dependencies that should be the same version. E.g. dependencies with separate packages for modules, like Jackson or Spring. And if the dependency has a BOM pom, that's not needed either.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: