Maven - Profiles (Profiles.xml)


Profiles give the ability of a project to change settings configuration depending on the environment where it is being built.


A project built for a test environment may point to a different database than that of the final deployment. Or dependencies may be pulled from different repositories based upon the JDK version used.



  • Excluding
mvn -P !public clean package
  • Including
mvn -P public clean package
  • Several
mvn  -P profile-1,profile-2


mvn help:all-profiles
Profile Id: repository-definition (Active: true , Source: settings.xml)
  Profile Id: get-hadoop-windows-native-lib (Active: false , Source: pom)
  Profile Id: assembly-windows-zip (Active: false , Source: pom)
  Profile Id: assembly-windows-unzip (Active: false , Source: pom)
  Profile Id: assembly-linux (Active: false , Source: pom)
  Profile Id: private-obfuscation (Active: false , Source: settings.xml)
  Profile Id: deploy (Active: false , Source: pom)

Documentation / Reference

Powered by ComboStrap