What's the best way to configure a Java & Maven based app for multiple environments?
-
At the company I work for, we are starting to look at streamlining our deployment process. Currently at the moment everything (build, test, deploy etc.) is manually done by a developer. We starting to look at automated builds, continuous integration etc. Currently, all builds are done by running Maven with a specific profile. That profile contains a series of properties that are placed in the various config files, resulting in a JAR/WAR for a specific environment (dev, staging, production etc.). A dev then deploys this manually. It works well but we do end up with huge POM files considering all the configuration in there. Is this the sensible thing to do continue doing going forward? I've seen a few websites saying that you should build one single build file & then config it afterwards using something like Chef or Puppet. Other places seem to suggest the same but having your config in a CI application. Finally there's pretty much what we are doing but instead of placing the configuration in your POM, you have a directory for each environment containing all the complete config files that is then added appropriately. I'm just generally curious about what Java developers are doing when it comes to building projects & CI. There seems to be very little information out there! Knowing what a few other companies are doing would be helpful!
-
Answer:
At the place that I am working for, our systems used to be set up almost exactly like what you guys are doing not long ago. Problems started arising quickly when we scaled our projects due to various business requirements. More and more "branches" of our business need to use our codebase but they need to be configured differently and the more you cram into those projects, the more responsibility you put on the dev, and you would certainly hate it when some legal restrictions come into the scene. Plus, one of the requirements from the higher-ups is that our code must be able to be quickly deployed half way around the world on any number of servers with little to no: 1- code change in our apps and 2- involvement from us at HQ. This effectively means we must also prepare ourselves for a move to the clouds if necessary. That was when we started using the Puppet approach. Our dev teams would be responsible for coding up the projects (of course) and then part of the automation process with Puppet whereas some others would set up server environments with their fancy business-sensitive data/configuration like database passwords etc by putting it in some other light-weight modules (like an ldap tree for example) "protected" from our eyes and give us a way to access it from our Puppet scope. Puppet not only takes care of the configuration, but also abstract away all of the deployment process details from us dev, making our lives easier and we have more room for other things. It is very neat. So I guess the way to go about this is to think for yourselves how you would scale your applications in the future. S,
Sean Phạm at Quora Visit the source
Related Q & A:
- What's the best way to start a small clothing line business?Best solution by Yahoo! Answers
- What's the best way to get a job in a restaurant?Best solution by Yahoo! Answers
- What's the best way to make a good impression at a job interview?Best solution by Yahoo! Answers
- What's the best way to connect a home theater system?Best solution by Yahoo! Answers
- What's the best way to become a lawyer?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.