gitmaventaggingrelease-managementmaven-release-plugin

Maven Release Plugin and Git Tagging Style


Does the Maven Release Plugin perform lightweight or annotated tags in Git? (Also, does it support annotated tags if it is defaulting to lightweight tags?)

For instance, I can tag a project by hand using either:

git tag v1.0.0 # lightweight

or, alternately,

git tag -a v1.0.0 # annotated

These are very different types of tags. The first is a lightweight Git tag, and the second is an annotated Git tag.

(Note: I know that the release:prepare goal performs commits with POM changes, which in effect simulates an annotated tag because it ties the tag to a new, specific commit, but my question is whether an annotated tag is the result, anyway.)

Background: Maven 3.3.9 and Git 2.7.4 on a Mavenized Java project. Not easy to find this answer on Google or in SO.

UPDATE: Tags by the Maven Release Plugin are always annotated. There is no support for lightweight tags. See the answer below and my comments to corroborate it.


Solution

  • While I didn't find documentation on this question (maybe it exists out there), I did a trial run. Create a local GIT repository with a simple POM and do a maven release:prepare. When I run git show $MYTAG on the resulting tag, git output contains "Tagger" data which suggests it is an annotated tag.

    https://git-scm.com/book/en/v2/Git-Basics-Tagging

    https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html