It is mandatory that your JDK be installed in a directory that does NOT have spaces. The default installer uses “C:\Program Files\Java\**” and I just put mine in “c:\Java\**” instead.

Local Repository

Your “c:\Documents and Settings\[userId]\.m2\settings.xml” is the location where you can override various project properties. And YES, this is the only exclusion to the above directory name rule.

The first property is going to be the location of your local maven repository


I like to put mine in a directory that has no spaces in the directory names such as “Documents and Settings” which is ok for Windows installations, but not for unix or Linux. I also like to have a standard place for my entire team to keep their local repository.


Determines whether maven should attempt to connect to the network when executing a build. This will have an effect on artifact downloads, artifact deployment, and others.


This is a list of proxies which can be used on this machine to connect to the network. Unless otherwise specified (by system property or command-line switch), the first proxy specification in this list marked as active will be used.


This is a list of authentication profiles, keyed by the server-id used within the system. Authentication profiles can be used whenever maven must make a connection to a remote server.

I use this setting for accessing Archiva via WEBDAV:


Assuming you have the userId and the password correct, you should be able to download, and upload artifacts to your Archiva Repository.

But if I want to give my team read-only access to the same repository, I use guest with no password:



If I want my developers to only use our internal local repository, I will create a mirror setting:



This is the most important section here. I use this to override several different sections for each project. I like to call this profile local as the default. You can also create more profiles such as build, stage, qa, prod. This way, the operations or build master can control more specific build information and passwords.


I use project root so that I have a base directory in order to reference some resources on a local developer machine.


SCM information can be added by each developer with these 3 properties


I like to deploy my site documentation locally to the temp directory. This way I can look at my code metrics during my build cycle.


The servers where mentioned above, but the repositoryUrl and snapshotRepositoryUrl allow each profile to override where the generated artifacts are going to get deployed to.


By setting the filter.file here, this allows each developer and each profile to select a different filter. This is a great way to have different build settings for different environments like build, stage, qa, and prod.


Another important property for Test Drive Development, is the ability to change the database you want to test against. While there are several profiles in the root:: pom.xml, the url’s and credentials are generic. So I felt I needed to give the developer the opportunity to override those 3 items here:

<!– these settings must be the same as the selected activeProfile Database below –>

That is all for a single profile


Active Profiles

Active Profiles are used to set the various profiles the developer wants to run. Below we have local as the only profile selected. If you want to also run against tomcat5.5 and mysql, all you need to do is uncomment tomca5.5 and mysql below

<!–======= Environment Specific =================================–>

<!–======= Choose one of container ===============================–>

<!–======= Choose one of databases ==============================–>

A full template version of a settings.xml from above is located at

Mick Knutson

Java, JavaEE, J2EE, WebLogic, WebSphere, JBoss, Tomcat, Oracle, Spring, Maven, Architecture, Design, Mentoring, Instructor and Agile Consulting.

View all posts

Java / JavaEE / Spring Boot Channel

BLiNC Supporters

BLiNC Adsense