Monthly Archives: November 2010
Set up the client environment for supporting Maven.
The Server Side Overview
Firstly I would like to inform you about my server side environment as following: -
| # | Component | Version | Remarks |
| 1 | The operating system | Windows Vista | |
| 2 | The Java | JDK 1.6.0_21 | |
| 3 | Maven | 2.2.1 | |
| 4 | The Apache Tomcat | 6.0.29 | |
| 5 | The CollabNet Subversion | 1.3.0 | |
| 6 | MySQL | 5.1.50 | |
| 7 | XAMPP | 1.7.3 | Apache HTTP |
| 8 | Artifactory | 2.3.0 | Deployed at tomcat |
| 9 | Hudson | 1.384 | Deployed at tomcat |
| 10 | Bugzilla | 3.6.2 | Deployed at XAMPP |
| 11 | OpenDS | 2.2.0 | The User LDAP |
Those 11 components are configured so that it can be worked together, The Apache HTTP is the contact point for any client who would like to use them. The HTTPS (SSL) is preferred for sure.
I use the “Artifactory” as a Maven Repository Manager. Why we need it? Please see further information here.
The Client Side Configuration
The client side need to be configured for supporting the Maven Repository Manager, too and here is the steps: -
Configure the Maven Configuration Home
Overview
The Maven Configuration Home is a folder contains the maven configuration file “settings.xml”. There are 2 location by defaults as
- The Maven Install: <MAVEN_HOME>/conf/settings.xml
- The User Install: <USER_HOME>/.m2/settings.xml
I prefer to use the user home instead. Please see further information here.
Steps
- Open the command line interface, for me the dos prompt from cmd.exe with the administrator permission.
- Change directory to your <USER_HOME> directory, for me is C:\Users\Charlee.Ch
- Create the directory/folder named “.m2” (dot m two) by using the following command: -
| Command |
| mkdir “.m2” |
- Open the web browser and go to the Artifactory application.
- On the left hand side menu, choose “Client Settings” –> “Maven Settings”
- On the right panel check the checkbox named “Mirror Any”, and select the “repo” from the drop down list.
- Click the “Generate Setting” button.
- The system will display the “Maven Settings” screen.
- Click the icon “Copy to Clipboard” and paste to your text editor.
- Add the following tag at the top (inside the <settings> tag) :-
| Tag for mentioning the local repository folder |
| <localRepository><YOUR_DECIDED_FOLDER></localRepository> |
| Example: <localRepository>D:/M2/Repository</localRepository> |
Please note, all downloaded resources from the Artifactory will be stored here. It is organized as a maven standard. You will not manage your resources anymore, let it manages for us. The resources is the java jar files, source codes and java documents.
At the moment we will download them from the remote repository via internet, later we will deploy our own resources to the repository manager and let other use us.
- Save it as “settings.xml” under the <USER_HOME>/.m2
Summary
At the moment my client is ready to be a Maven Client and is connected to the Maven Repository Manager. You can find more information about the configuration from the Maven website and the Artifactory website.
Next I will use the IDE to work with this setting, please stay tuned as always.


