Maven Profiles: Detailed Explanation
Maven is so much portable and customizable. You can customize your maven build based on the user, environment, server …etc. with the help of profiles. Based on profile values it can able to override the default maven build behaviour. Over this article, let's see how to make a maven profile and how to customize the build based on profile values.
The profile is a great feature on Maven. Using profile it is able to customize the build for different environments. The maven build can be deployed on different environments say staging, development, production…etc. Based on each environment the build configuration may differ.
Say example in a development build it is using the development database configuration, it may not compress the javascript files and the build is compatible with web servers.
But comes to production configuration, the build is using prod database, it will compress the js and CSS, core data are encrypted, and the build is for application servers. Using profile these all can manage
The basic idea behind the Profile is, the profile comes with an alternative configuration that will override the default configuration. So if you make the maven build with a profile, then it will override the default configuration with the profile configuration