Skip to content

Automatic project version generation using maven extensions

License

Notifications You must be signed in to change notification settings

belwals/ci-versioning-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ci-versioning-extension

Automatic project version generation using maven extensions

Uses:

Plugin takes care of generating maven version based on the latest commit hash so that version can become CI friendly.

Please follow the below steps to set up the project

  • Add a file extension.xml under .mvn folder which is on the base directory of your maven project with the below content

    com.sab.maven ci-versioning-extension 1.0.0

  • Follow projection version convention as below. So that placeholder revision will be updated by plugin in the runtime

    • Single module project:

        <groupId>xx.xxx</groupId>
        <artifactId>xx</artifactId>
        <version>${revision}</version>
      
        <prerequisites>
            <maven>3.3.1</maven>
        </prerequisites>
      
        <properties>
            <revision>SNAPSHOT</revision>
        <properties>
      
    • Multi module structure:

      • Parent POM

        xx.xxx xx ${revision}

        3.3.1 SNAPSHOT
      • Child POM

        xx.xxx xx ${revision} 4.0.0 child.xx.xx
  • We are almost done compile the project as usual.

Improvements:

  • Version on target pom.xml is not updating i.e placeholder revision can't be updated with the dynamic version which needs to be insvestigated.

About

Automatic project version generation using maven extensions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages