In the previous chapters, we saw how to configure the build of our project. However, we did not address the problem of build portability in the previous chapters. With build portability, we measure how easily we can port a build configuration across different environments. A nonportable build will need more configurations and hacks compared to a portable build.
Of course, portability is sometimes not entirely possible. Some plugins and some applications' configurations might depend on resources that are related to a specific environment.
In order to address such circumstances and facilitate build portability across environments, Maven introduces the concept of a build profile. A build profile is a set of POM elements that you can optionally activate by overriding the corresponding tags in a POM file. This is the only point in which you need to define environment-specific settings.
Profiles modify the POM file at build time by overriding the POM settings according to the...