Previously my understanding was that the purpose of the @version
tag was to show to library users in which release a particular file was last changed. For example, if there is a new release for liblibrary v1.7, and its developers maintain @version
tags in sources in actual state (either manually or with an automated tool), then one could look at the sources artifact and see whether that particular file has changed since previous version 1.6.
But here is a piece of documentation for javadoc, which says that @version
tag in each source file should merely hold the current release version of the whole artifact.
From javadoc - The Java API Documentation Generator:
This tag is intended to hold the current version number of the software that this code is part of
But I don't see any usefulness in that at all. Why would anyone have the current release in each source file if you can see it in your build tool (before the artifact is built) or in the name of the artifact (after the artifact is built)?
So can you specify exactly what should be in the @version
tag: the version when that file had last changed (so every file in a source artfiact potentially has its own @version
tag), or just the version of the artifact (so every source file has the same @version
tag)? Is the former approach actually ever used?