If I understand you, you create separate ears / wars / banks for each environment on your continuous build server. It is right?
I have two ways to handle this: Smart Way and Dumb Way:
Smart way
The smart way is to configure the application server (JBoss, Weblogic, etc.) to find the desired properties file external to jar / ear / wars installed on the application server. This way you create one set of beat / ear / war, and it works everywhere. In addition, you are doing something very, very important: you call Finger O 'Blame elsewhere.
If the properties files are packaged as part of the jar / ear / war and something on the server has changed, you will get the fault because your build was bad. Of course, you had no way of knowing that they changed the environment, but you installed this bad build file on a production server.
However, if the properties are stored outside the build artifact, then this is the command responsible for setting up servers that do not work.
In fact, it is much easier for the team responsible for setting up the application server to deal with this problem. They know what has changed, and they can update the properties file to reflect this change. Not only that, but you only need to create and distribute one set of artifacts. You donβt need to worry about whether the new environment is configured if something changes in the old environment. In fact, changes can be easily implemented without forcing you to create a new version.
Stupid way
We were able to do something Smart Way in my last company. In my current company, we are doing Dumb Way things. Properties are built into our build artifact, and there is no easy way to change it.
I split each set of property files with a suffix instead of different directories (e.g. build.properties.dev1, build.properties.dev2, etc.). We placed the property files in one directory.
When I do the assembly, I use the AntContrib <for> task to cycle the build process several times, each time with a different property file. Then I create an artifact for each set of property files. I use the suffix in the properties file as the folder names in my target directory, where I store inline artifacts. Thus, each assembly creates all artifacts for the entire environment.
Thus, if the artifact worked in a dev environment, it will work in QA and Production. The only problem is that I store 5-10 times the number of artifacts on my Jenkins server, so I need 5-10 times more disk space.
By the way, as long as I can define
<fileset> to find the property files, I can use the
<for> task, so you can use different directories. And you can use
<basename> to delete directory names.