Build and Release with Maven


While releasing  application to UAT or Production environment, following actions/goals should be performed.

  • Commit all changes to SVN trunk repository
  • Change pom version from SNAPSHOT to actual release version. For example if current development version is 1.0-SNAPSHOT, then make it to 1.0 release version
  • Tag this release in SVN repository
  • Increment the development version in trunk.

All above steps can be performed using Maven release command.

mvn release:clean release:prepare -DscmCommentPrefix=”DESC”


  • scmCommentPrefix is the prefix for SVN commit comment. Normally this would JIRA ID.

Optionally you can insert below properties.

  • -DdevelopmentVersion is the current development SNAPSHOT version
  • -DreleaseVersion is the actual release version, which is normally without SNAPSHOT string

The command will

  • Check for any local outstanding changes – and if any are found, it will fail. Note that any tests which do not clean up properly may cause issues here and you may need to manually delete such files.
  • update the local POMs to new (release/non-SNAPSHOT) versions
  • compile and run the tests
  • commit the updated POMs (with the release versions) to the release branch
  • generate a new tag from SVN from the release branch
  • update the local POMS to new development SNAPSHOT versions
  • Commit new POMs to the release branch (with development SNAPSHOT versions).


maven sertting.xml example file

<settings xmlns=”″

<username> XXXXXX</username>







Connecting to svn from Java app – pom file

<!– ============================================================= –>
<!– Source control system –>
<!– ============================================================= –>


Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *

5 × five =