Thursday, June 26, 2014

Customized Maven Settings for Different Workspace - One Workspace Per Project

I've been looking for a solution on how to customized the maven settings for different project but there was none. So, I've created my own solution on this blog on how to do it, instead of customizing each project, I basically configure it on each workspace. My practice is one workspace for each project. This is what I have done so far:

Step 1: 
  • Open Eclipse or Springsource Tool Suite (STS) IDE
Step 2: 
  • Click Window - Preferences
Step 3: 
  • In Filter box, enter "Maven"
Step 4: 
  • Click the Installation and add the Maven home that you have in your computer. In my case I downloaded Maven 3.2.1 then extracted the TAR.GZ file to C:\Devtools\Apache\Maven\3.2.1
Step 5: 
  • Click User Settings then Browse the settings.xml file. In my case the location of the settings.xml is C:\Devtools\Apache\Maven\3.2.1\conf\settings.xml then click Update Settings and click Apply then Click OK.
That's it. That's my 5 easy steps.

Regarding changing the path of your local repository, you need to add the following code inside the settings.xml file from our maven conf directory:

<localRepository>D:/Devtools/Maven/Repository</localRepository>