0

Am very new this kind of S/W development industry and since am here as system engineer, my task is to implement a Build and Release management system using Jenkins. So, far am able to install, configure and even build the war files for my java proj using maven after checking out the sourcecode from my svn. Now the actual task it to build mutliple war file for the same proj for my different environment like UAT, Staging and Prod. I dont want to create multiple jobs, however I would like to use the multi-configuration option to achieve this. So, can anyone please help me in doing this?

Thanks, Sree

Sree
  • 1

1 Answers1

0

I strongly advise against building environment specific release binaries. Instead address what it is that makes one environment different from another. Generally it is configuration held in property files recording information like:

  • Database URLs and credentials
  • System sizing information
  • ..

Baking this into the release makes your software very inflexible. For example why should you have to rebuild your software everytime the database password is changed?

The solution is the use of standards like JNDI. In tomcat you can use context files to set datasources and other variables.

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • Mark, thanks for replying. Yes, you are absolutely right. The requirement is to build the war files containing environment specific app.properties and jdbc.property file. So, you mean to you to achieve this we need to use standards like JNDI (sounds very new to me) since am being a hardware system engineer. Can you please help me here. Thanks once again, Sree – Sree Feb 07 '14 at 04:47
  • @Sree What's great about JNDI is that it's a java configuration standard. The problem with JNDO is that there is no standard in how to implement it in each container....(J2EE left that to the container vendors, which has created this mess). To get you started with with tomcat, I would recommend this answer: http://stackoverflow.com/questions/13956651/externalizing-tomcat-webapp-config-from-war-file . Create the special application context file and use this to override environment settings in your application's web.xml. Once you get it working you'll never look back. – Mark O'Connor Feb 07 '14 at 10:17
  • Mark, thank you so much.. would go thru this and let you know the outcom :-) – Sree Feb 07 '14 at 16:43