Maven Release plugin

less than 1 minute read

Useful commands

1
2
3
4
5
6
7
8
9
10
	1. Prepare
	mvn release:prepare
	2. Perform release
	mvn release:perform
	3. Update develop version number
	mvn release:update-versions -DdevelopmentVersion={version}
	4. Update version from released source.
	mvn versions:set -DnewVersion=1.0.CR-SNAPSHOT.
	5. Batch release (non interactive)
	mvn -B release:prepare

POM configuration

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<scm>
   <developerConnection>
       scm:svn:http://xxx/trunk
   </developerConnection>
</scm>
<distributionManagement>
   <repository>
       <id>ReleaseUniqueId</id>
       <name>UniqueReposityName</name>
       <url>file://///computer/directory/maven_release</url>
    </repository>
</distributionManagement>
<build>
   <pluginManagement>
       <plugins>
           <plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-release-plugin</artifactId>
		<version>2.5.1</version>
		<configuration>
                   <commitByProject>false</commitByProject>
                   <scmCommentPrefix>see #ticket </scmCommentPrefix>
                   <autoVersionSubmodules>true</autoVersionSubmodules>
                   <username>user</username>
                   <password>pass</password>
                   <tagBase>
                       http://xxx/tags
                   </tagBase>
                 </configuration>
             </plugin>
         </plugins>
    </pluginManagement>
</build>