I developed an application, and its final war was OK in a development mode but it contains some configuration files which I need to externalize for production. I was able to man
Please DON'T use profiles for this. The problem with profiles is that the resulting artifact contains no information about the profiles used to build it.
Basic rule: A profile must not change the result of the build.
Or the other way around: If you build the same source code revision, the result must be identical, regardless of profiles or arguments.
(see How to really use Maven profiles (without endangering your karma) for more information)
So, a better way to do it would be to create two war modules, say my-project
and my-project-dev.war
.
If my-project-dev.war
has a war-dependency on my-project.war
, it will use your production war as overlay, resulting in a combined war files using your production and your development time resources.
Added bonus feature: in your development war, you can override entries of your production war (say, logging-config).