Deane
Deane

Reputation: 8747

Is there any functional reason for including the version number in the name of a JAR file?

In Java, I often see JAR files named with the version number of the software (jsoup-1.11.2.jar), while others are not (freemarker.jar).

Is this just a best practice/convention, or is there some functional reason for it?

Upvotes: 1

Views: 54

Answers (2)

GhostCat
GhostCat

Reputation: 140457

Simple answer: no, this is purely a convention.

Obviously, tooling that checks versions can do that easily when version numbers are hard-coded like this. But there is no generic (like jvm based) tool relying on it.

And beyond that - sometimes this scheme is even counter productive. In our self grown build setup we have to always remember to update the build scripts after replacing JAR files - because a new version changes the file name (because version part of the file name).

Upvotes: 2

vandench
vandench

Reputation: 2233

Having the version in the name of the file allows you to quickly determine which of the n files you have is the latest. Also if you have no way of determining what the version is from within the program it can be helpful.

Upvotes: 0

Related Questions