Is there any way to avoid developers download all dependencies and have those dependencies located to shared locattion to all the developer and each developer working on project point to that location?
Can anyone explain with sample files and example?
I understand what you want but i sure you that this is not a good idea. Because later conflit will happen as soon as 2 developer start working at once on same project
I think you are looking for http://www.jfrog.com/home/v_artifactory_opensource_overview
Artifactory has nice user-guide and easy to understand. I have not much experienced it but it is really powerful.
Maven is resolving and updating dependencies. You´ll always have a local instance of your repo somewhere. You can configure the local repository and other profiles in the settings.xml in your .m2 folder.
For example the local repo looks like
<localRepository>C:/dev/.m2/repository</localRepository>
It probably also resolves shared filesystems. You can also add an internal repository for your own maven artifacts on a fileshare as
for example. Read more about repositories here http://maven.apache.org/guides/introduction/introduction-to-repositories.html
You can change local repository like this:
look this article
I think if you make shared folder and all other developers write path to this folder this can help.(but I didn't try this)
UPDATE
Using shared repo is bad idea. Sharing local repository between two or many users is not thread safe and may result in different errors.
So as many people mentioned here use Artifactory
Best is to go with one of the repository managers for maven. The main steps for the setup will be: - Install a central repository on an internal machine - Configure the central repository to proxy the repositories you need for your developers - Modify the developers maven settings to use the internal maven repository as mirror for everything (see here for details)
There are 3 well-known repository managers available:
I favorite Artifactory - the installation and configuration took less than an hour. Now if a developer adds a new dependency to a maven project, the artifact will be downloaded from the original remote repository to the internal repository and will be made available. When the next developer needs the archive it will be downloaded from the internal repository - the access will be much faster.