Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the usage of Maven pom.xml - <tag> element inside of <scm> when you are using git

We are using maven and git together for a Java project. In <scm> section, <tag> is automatically added by release plugin.

For example,

  <scm>           <connection>scm:git:http://myserver:7990/scm/project/test.git</connection>           <tag>releaes-tag</tag>   </scm> 

What does <tag> represent here?

I believe the normal convention is <tag>HEAD</tag>.

When we were using subversion, maven never used <tag></tag>

What is the meaning of <tag></tag>?

I searched google and maven documentation but I cannot find any information on it.

like image 927
mjlee Avatar asked May 18 '14 04:05

mjlee


People also ask

What is the use of SCM tag in POM xml?

Assuming that SCM has been configured in the pom. xml and the project directory is managed by a SCM, invoking the checkin goal in the scm will start the commit process for all configured sources in your pom. xml. The files should be added beforehand by an external scm client.

What is SCM in Maven POM?

Maven SCM supports Maven plugins (for example maven-release-plugin) and other tools by providing them with a common API for source code management operations. You can look at the list of SCMs for more information on using Maven SCM with your favorite SCM tool.

What is tag in Maven?

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>


Video Answer


1 Answers

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 by https://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.

like image 200
Joe Avatar answered Oct 05 '22 22:10

Joe