<blockquote>
  <p>then I can tag the codebase whatever I want like v.0.1</p>
</blockquote>

<p>One could use <a href="http://semver.org/" rel="nofollow noreferrer">semantic versioning</a>, i.e. X.Y.Z. instead of v.0.1</p>

CC BY-SA 3.0
2017-10-20T20:06:36.867Z
2017-10-20T20:06:36.867Z
030
<p>I would recommend to use the <a href="http://maven.apache.org/maven-release/maven-release-plugin/" rel="nofollow noreferrer">maven-release-plugin</a> wich will take care of the sync and keep the version and tag equal. As you can read <a href="http://maven.apache.org/maven-release/maven-release-plugin/usage.html" rel="nofollow noreferrer">here</a></p>

<blockquote>
  <p>The <code>developerConnection</code> contains the URL of the Source Control Management system pointing to the folder containing this pom.xml This URL is prefixed with <code>scm:[scm-provider]</code> so the plugin can pick the right implementation for committing and tagging. The Maven SCM-page contains an overview all the supported SCMs, per SCM you can see how the URL should look like. </p>
</blockquote>

CC BY-SA 4.0
2019-09-25T16:02:56.270Z
2019-09-25T16:12:33.213Z
2019-09-25T16:12:33.213Z
papanito
<p>Given the following situation:</p>

<ul>
<li>in a POM file in the repo root (Atlassian BitBucket) I can define that this POM has e.g. the version <code>0.0.1-SNAPSHOT</code></li>
<li>then I can tag the codebase whatever I want like <code>v.0.1</code>.</li>
</ul>

<p>This would be then inconsistent versioning. Is there a better/established way than some custom scripting to control sync of this?</p>

<git><maven>
How to automate control of synchronization between Maven artefact version and Git tag?
Ta Mu
# How to automate control of synchronization between Maven artefact version and Git tag?

(Asked by: username_0 on 2017-06-25)

Given the following situation:

* in a POM file in the repo root (Atlassian BitBucket) I can define that this POM has e.g. the version `0.0.1-SNAPSHOT`
* then I can tag the codebase whatever I want like `v.0.1`.

This would be then inconsistent versioning. Is there a better/established way than some custom scripting to control sync of this?

**Tags:** git, maven


---

## 2 answers

### Answer by username_1 on 2017-10-20. Score: 2

> then I can tag the codebase whatever I want like v.0.1

One could use [semantic versioning](http://semver.org/), i.e. X.Y.Z. instead of v.0.1


---

### Answer by username_2 on 2019-09-25. Score: 1

I would recommend to use the [maven-release-plugin](http://maven.apache.org/maven-release/maven-release-plugin/) wich will take care of the sync and keep the version and tag equal. As you can read [here](http://maven.apache.org/maven-release/maven-release-plugin/usage.html)

> The `developerConnection` contains the URL of the Source Control Management system pointing to the folder containing this pom.xml This URL is prefixed with `scm:[scm-provider]` so the plugin can pick the right implementation for committing and tagging. The Maven SCM-page contains an overview all the supported SCMs, per SCM you can see how the URL should look like.


---

