4zh4r_s4l4ti
4zh4r_s4l4ti

Reputation: 1574

Maven repositories

We are using maven in the development process. Maven provides a nice feature of configuring the repositories. Using this feature I have created a remote internal repository and I can download the dependencies from that repository. The development machines are pointing to this remote internal repository. Each development machine has its own local repository(~/.m2/repository/) and hence the dependencies of the project are downloaded from the remote internal repositor**y to the **local repository(~/.m2/repository/) on each developer machine.

Is there any way that the local repository(~/.m2/repository/) on developer machines can be set to the internal remote repository that we have created and which is used for downloading the dependencies from.

Upvotes: 0

Views: 759

Answers (3)

Raghuram
Raghuram

Reputation: 52635

Is your requirement to avoid each developer from having to download all dependencies to his local repository?

Assuming your remote internal repository has the same format as a maven local repository, you can achieve this by adding the following line in the settings.xml of all your developers.

<localRepository>shared-drive-location-of-remote-repository</localRepository>

Upvotes: 0

stacker
stacker

Reputation: 68942

May I suggest another approach to share dependencies and artifacts. In our projects we use nexus as a proxy and repository for our artifacts. It works well with no issues. A basic configuration I already posted here.

After nexus is running you could also setup continous integration using jenkins and enjoy a fully automated environment.

Upvotes: 0

amra
amra

Reputation: 16875

If take a look on Maven Introduction to Repositories first paragraph says:

There are strictly only two types of repositories: local and remote.

There is no way how you could change this behavior.

If you would handle that differently it would cause many problems. E.g. build would take much longer because of downloading file all files, IDE would work not work properly (project dependencies would not be stored local), ...

Upvotes: 1

Related Questions