What is the usage of Maven pom.xml - <tag> element inside of <scm> when you are using git
The <tag>
element is used by release:prepare
to specify the tag that was created for this release (implemented as MRELEASE-723). Outside of a release it is essentially a placeholder, and HEAD
is an appropriate value.
When we were using subversion, maven never used
<tag></tag>
As MRELEASE-723
explains:
when I invoke release:prepare with a URL like:
https://example.test/svn/REPO/myproject/branches/release
it will be replaced byhttps://example.test/svn/REPO/myproject/tags/myproject-1.0
which is fine because now you know which revision to checkout for building the release.
The <scm>
element for a release build should contain enough information to check out the tag that was created for this release.
Subversion allows the tag to be included in the connection URL. Neither Git nor Mercurial allow this, so the <tag>
element is used instead.