Expand my Community achievements bar.

Automatic increment in build release verison

Avatar

Level 1

Hi 

I want to auto increment project build release version with each jenkins deployment. My jenkin has following goal seetings[1]. I created project by using command[2] and following URL[3]. Please provide guidance, how could I set auto incremental build release version for my project? 

As of now, My project is building successfully but with version containing "SNAPSHOT" keyword.

[1] clean install -Dcq.password=password dev-author

[2] Command: 

$ mvn archetype:generate \
    -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ \
    -DarchetypeGroupId=com.day.jcr.vault \
    -DarchetypeArtifactId=multimodule-content-package-archetype \
    -DarchetypeVersion=1.0.2 \
    -DgroupId=my-group-id \
    -DartifactId=myproject \
    -Dversion=1.0-SNAPSHOT \
    -Dpackage=com.mycompany.myproject \
    -DappsFolderName=myproject \
    -DartifactName="My Project" \
    -DcqVersion="5.6.1" \
    -DpackageGroup="My Company"

[3]: https://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/how-to-build-aem-projects-using-... 

Thanks in advance

4 Replies

Avatar

Level 1

I have tried this but through Jenkins it is not working. So anyone tried to update Build release number by using Jenkins? 

Avatar

Administrator

Hi 

Please have a look at this post:- 

Link:- http://stackoverflow.com/questions/12369233/incremental-build-in-jenkins

//Incremental build in Jenkins

  • Using parallel builds. In my experience in large projects this works great and can greatly reduce the build time with minimum (if any) risk. Just execute something like mvn -T 1.5C clean install https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3

  • If your modules are independent you can rather move them to different projects and glue them together by using maven dependencies.

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni