Building Projects: Learn to Set Up A Maven2 Repository


• Import artifacts into the repository in bulk.

• Export artifacts from the repository in bulk.

• Setup the task to backup the repository automatically.

Criteria for choosing a maven repository in ideal condition

A maven repository implementation
should be:

• Free and open source
• Provide admin tools
• Easy to setup and use
• Provide backup facility
• Able to create, edit and
delete sub repositories.
• Anonymous read only access and also access control facility.
• Deployable in any standard web server such as Tomcat or Apache.
• Issue tracker, forums and other independent source of information.
• Active community developers make the product enhanced and bugs fixed.
• Bulk import/export facility to move groups of artifacts into the repository and out of the repository.
• Provide a repository browser: should be a web browser instead of the desktop application.


Getting Hands On Setting Up Internal Private Repository For An Organisation

We have set up an internal Maven Repository for our organisation so that the developers are not wasting time in searching and downloading the required project libraries. This also allows us to have a single company wide repository for project artifacts. The setup steps are not too much complicated but we didn't run into several issues while settingup the local repository server (artifactory), for the first time.

When you're using maven at your company, you almost always want to setup local maven repository as relying on ibiblio for nightly / production builds is not a great idea and it takes time to download the library files if your development team is big. When setting up a local repository you don't want to setup the entire ibiblio repository locally as it is huge and has more libraries than you'll ever be using for your project. Maven-repository (in our case maven artifactory) is a repository server, which acts as your internal maven repository and downloads jars from ibiblio or other public maven repositories on demand and store it for further use in the project builds. And all this is transparent to the developer running a maven build.

The other thing about local maven-repository is that it allows you to neatly separate and


organize jars that might not be available on ibiblio i.e. the 3rdparty artifacts (some company specific shared library or a commercial library).

Software requirements to set up the maven repository:

• Artifactory: Download and install the artifactory from the site http:// artifactory/latest/. Artifactory comes with the application that can be installed into Tomcat.
• JDK 1.6: Get the information for downloading and installation from the site sites /artifactory/latest/ install .html.
• Tomcat 6.0

A Quick glance at
the steps of how we set up our local
maven repository :

1 Download the appropriate file. You can get it from http:// artifactory/latest/. Download and unzip the file in your directory of choice. We have downloaded artifactory- at our end.

2 Lets take the Installation directory as D:\artifactory- 1.2.2\artifactory-1.2.2, Extract the artifactory- into the <artifactory-install-
directory> directory.

Sept 2007 | Java Jazz Up |26
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,   Download PDF