pom.xml, profiles.xml and settings.xml

Those are the three files which control lifecycle and settings of the Maven build process.


Clearly the most important file. It is an XML file which contains the essential information about a Maven project:

  • dependencies
  • plug-ins
  • goals to execute

In theory is the only mandatory file, however is good practice to store properties and settings externally (in the other files) and make the pom independent (or at least low coupled) with the specific developer’s environment.


It enables the developer to define one or more profile descriptor. For example you could have an Oracle and a PostgreSQL profile:


Notice how properties are defined: just name the xml tag after the property, then this can be used within the pom (e.g. ${db-username}).


Settings.xml contains those attributes which are not bundled with the project therefore not distributed. Those could be specific profiles, repository location, etc..

Settings.xml can be placed in the {user.home}/m2 (on Windows C:\Documents and Settings\{user}\.m2)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: