Various configuration files for dev and prod using Maven

I have different log4j.xml files and properties that should be used in Dev and Production. I use maven for assembly and packaging. Is there a way I can let maven select dev or prod by using the maven configurable property in the POM or by passing a runtime variable?

Thanks Abi

+5
source share
3 answers

The idea based on profiles in Maven is not the best, because it will force you to run your assembly a couple of times, which means that if you have two environments, you will have to run your assembly twice if you just think about it, Best The solution is to work with Maven-Assembly-Plugin to create a set of artifacts for different environments in one step, which will be different classifier. I made a complete example here .

+6
source

Yes, use Maven profiles .

, POM ( ), . POM , , (, , , ).

+2

, "dev" "prod" , maven-assembly-plugin, "dev" "prod" .

+2

All Articles