Search code examples
mavenmaven-2maven-3maven-release-pluginmaven-scm

maven scm - Does maven creates tag automatically?


I have below configurations in place -

<scm>
<connection>scm:svn:http://example.com/tags/MyProject/MyProject-0.1</connection>
<developerConnection>scm:svn:http://example.com/tags/MyProject/MyProject-0.1</developerConnection>
<url>scm:svn:http://example.com/tags/MyProject/MyProject-0.1</url>
</scm>

My question is each time version changes for my project above scm configurations will change. say from 0.1 to 0.2 and so on... Do we need to make sure these tags created in svn or does maven creates the tag? if Maven creates the tag with my above configuration I already have http://example.com/tags/MyProject available but it's not tagging the above?

Can anye fill me some thoughts please?


Solution

  • If the configuration is correct and you are using maven-release-plugin which means

    mvn release:prepare 
    

    than a SVN tag is created automatically by Maven. So there is no need to check. Apart from that it could happen that you need to change the tag-Base in the Maven-release-plugin if you have a different SVN layout which is not like:

       Repo
        +-- Project
                +--- trunk
                +--- tags
                +--- branches
    

    which means you need to configure the maven-release-plugin:

    <project>
      ...
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.4.1</version>
            <configuration>
              <tagBase>https://svn.mycompany.com/repos/myapplication/releases</tagBase>
            </configuration>
          </plugin>
        </plugins>
        ...
      </build>
      ...
    </project>