0

I am new to ant and Ivy. We are using Jenkins for CI with ant for builds, Ivy for dependency manger. We have several modules/projects which generate jars and wars, which can be independently versioned and released (not all modules will be released at the same time), so, need to maintain version number separately for each module. We want to use the version format A.B.C.D (ex: 1.2.1.2). I found I can use a property file to enter a version number and use ant BuildNumber task to increment the number for our nightly builds. So, once all the features are in and tested we move the last successful nightly build as new released version but we want to change the version number without rebuilding it. For example last successful build was 1.2.1.20 and it was tested thoroughly and has all the feature, we have to make this build from 1.2.1.20 to 1.3.0.0 without rebuilding the modules. How can I do that using ant? And also I need to publish them to my shared repository with the version 1.3.0.0. How do I do that?

Also, we want to create a zip file for each module with all dependency files along with the module's jar file for delivery. Is there any ivy or ant tasks that can help to create this?

tigger tigger
  • 109
  • 2
  • 9

1 Answers1

0

I think you've asked two questions...

Generally, every build I create is releasable so I'm always incrementing the last digit in my release number scheme. For controlling the version number I prefer to use the ivy buildnumber task, which increments based on what has been previously pushed to your repository (very useful).

Creating a zip package is quite straight forward. Just alter your ivy file to publish more than one artifact.

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • Initially I will not have any builds in my repository, so how does ivy buildnumber task work? Does it use 1.0.0.0? How do I force it to use 1.2.1.0? Can you please provide an example? Also, for nightly build I want last digit to be increased but for major releases I want the second digit (i.e. 2 in the above example) to be increase? how do I do I do that? Also, can you please provide an example of ivy.xml file which publishes dependencies along with build jar. – tigger tigger Sep 24 '13 at 12:40
  • This is another question, but initially we want to publish our artifacts to our test repository and once testing is done, we have to copy the same artifacts to the released repository. Does the Ivy has any tasks that help with this? Sorry, I am asking too many questions, I am very new to Ivy and ant, have very short time to figure out the stuff to achieve the end goal. Thank you so much for your help. – tigger tigger Sep 24 '13 at 23:02
  • Mark, for copying files form one repository to other, it looks like I can use Install ivy task. Is this correct? – tigger tigger Sep 25 '13 at 14:27