Maven profiles – to manage dependencies
Creating a pom.xml for all your needs sometimes causes un-necessary dependencies downloaded to your project.
Following pom.xml defines Maven profiles, which when invoked, will download only required dependencies (based on project needs):
Inorder to install profile specific dependencies, we can build the project from command prompt with following syntax:
mvn -Ptest2 clean install <== to install test2 dependencies mvn -Ptest clean install <== to install test dependencies