maven build profiles

Maven build profiles

Maven build profiles provides the facility to build project using different configurations. Instead of creating two separate POM files, we can just specify a profile with the different build configuration and build the project with this build profile when needed.

The profiles element is used to specify the maven build profiles inside the POM file. Each build profile is nested inside a profile element. The elements inside the profile element will override the values of the elements with the same name further up in the POM. The activation element inside the profile element is used to describe the condition that triggers the build profile to be used. We can use settings.xml file to tell maven which profile is to be executed. Another way is to add -P profile-name to the Maven command line.


<project xmlns=""

Please follow and like us:
Content Protection by