title: JavaEE solution configuration best practices
body: <p>We build 3-tier enterprise solutions that typically consists of several webapp and ejbjar modules that all talk to a db and have several external integration points.</p>
  
  <p>Each module typically needs its own configurations that can change over the solution's life time.
  Deploying it becomes a nightmare because now we have 18 property files that must be remembered to copied over and configured also setting up data-sources, queues, memory requirements etc.</p>
  
  <p>I'm hopeful but not optimistic that there can be a better way.
  Some options we've considered/used, each with it's pros and cons:</p>
  
  <ol>
  <li>Use multiple maven projects and continuous integration (eg. hudson or jenkins) to build a configuration jar that includes all the property files for each environment (dev, qa, prod) and then bundle everything up as an EAR. But then things can't be easily changed in production when needed.</li>
  <li>Put most of the settings in the DB and have a simple screen to modify it. Internally we can have a generic configuration service EJB that can read and modify the values. Each module can have a custom extended version that have specific getters and setter.</li>
  <li>Version control all the property files then check it out on production and check it into a production branch after making changes.</li>
  </ol>
  
  <p>With all of these you still need to configure data-sources and queues etc. in a container specific way :(</p>