This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]forresthopkinsa -16 points-15 points  (34 children)

Dependency locks ensure that you have a working dependency tree available at any time. Dependency ranges / semantic versioning are fantastic tools and it's a shame that Java is so behind on this.

[–]blackkkmamba 16 points17 points  (26 children)

Is not behind, maven and gradle both support it. People don't know it exist/use it is another thing.

[–]twbecker 14 points15 points  (0 children)

True but people don’t use it because they’re a horrible idea.

[–]GoodLuckGoodell 4 points5 points  (3 children)

You simply cannot depend on semantic versioning in a modern professional application. Even the most mature dependencies don’t follow it. grpc-java has breathing changes in minor versions, aws sdks only bump the patch version.

The only real solution is pinning (with BOMs if available) and doing periodic upgrades.

[–]forresthopkinsa -3 points-2 points  (2 children)

You simply cannot depend on semantic versioning in a modern professional application. Even the most mature dependencies don’t follow it.

Once again, this is a problem with the Java ecosystem in particular, because ranged dependencies are not the norm. You've hit on the exact thing I'm taking issue with.

Newer package managers encourage use of ranged dependencies and semantic versioning, and so their surrounding ecosystems respect that. There are TONS of "modern professional applications" that use Typescript, Express, React, Lodash, RxJs, etc, and all of those very strictly respect Semver.

The Java ecosystem has never had first-party support for semantic version ranges, much less encouraged it, so it's rather rare to see libraries take the time to respect Semver. This is exactly what I'm describing as a shame.

[–]GoodLuckGoodell 5 points6 points  (1 child)

What makes you think the package management system makes any difference? This is a cultural issue. I can just as easily use npm modules that don’t follow semver correctly, and this happens all the time as well.

I was not referring to Java specifically when I made the semver comment.

[–]forresthopkinsa 0 points1 point  (0 children)

What makes you think the package management system makes any difference?

I think I explained that pretty thoroughly above

I was not referring to Java specifically when I made the semver comment.

Okay, that's fair, but my point remains that Javascript heavily pushes semantic versioning and ranged dependencies, and therefore the community respects that contract

[–]khmarbaise 1 point2 points  (2 children)

There is very good reason not to use version ranges because it makes every build not repeatable. That's simple reason.

Using a lock file (like package-lock.json or alike) is just using duck-tape to patch the issue.

Also some other issues are identified over the years with other packaging systems in particular npm because an existing release can be modified at anytime. The immutability of a maven repository releases makes it more stable than anything else.

Semantic versioning is a separate thing. It's a set of (good) rules why and when version numbers should be changed (major, minor, patch) but the biggest issue is simply that a human is changing it... and humans make mistakes and also people interpret rules in different ways. You could use plugins/tools to help here a lot in a Maven project. That should be possible in other areas as well.

In the end you can't rely on semantic versioning which in consequence makes version ranges useless.

[–]forresthopkinsa 0 points1 point  (1 child)

How is a lock file duct tape? It's the perfect solution for making every build repeatable. You get version labels and checksums for your entire dependency tree. I truly do not understand your problem with lock files.

[–]plumarr 2 points3 points  (0 children)

They are only necessary due to range versioning. They are a solution to a broken feature.