Reputation: 193
When you clone an eclipse project from a repository, project's build path contains errors because of missing libraries. So each member of the team has to search and put the library jars to same location so that , when we clone a project, we don't have any problem. Or they have to rearrange their build path after each cloning operation.
What is the best practice for avoiding this ?
One of the approach is to put all jars into some network share \\xxx\libraries, and add the jars from this network share. But is it the best idea ?
Upvotes: 4
Views: 2187
Reputation: 72676
The best solution will be using a build tool like Maven that can resolve missing dependency libraries for you. However if you don't have too many libraries in your project you can leave they in the git repository and track them, i have several project where i have lib into the repository and it is an handy solution because i can restore for example an older version of a library if needed. So the best way to menage your libraries depends on the situation, if you don't have so many libraries you can track they in the repository, otherwise it is better using Maven.
Upvotes: 0
Reputation: 106401
I use Maven to manage all dependencies for my projects in Eclipse.
That way all the libraries get downloaded automatically by Maven and you don't need to do any manual fiddling with lib folders etc.
Upvotes: 0
Reputation: 752
In our project, we add the '.classpath' file to the repository. This contains the list of referenced libraries.
The libraries themselves are checked in to the repository as well under 'lib' folder.
We find this easier so when ever someone adds libraries to the project, they check out '.classpath' and add the updated one.
Upvotes: 2
Reputation: 97517
First use a version control tool. Second in particular in Java Develop you need a build system which handles the libraries you are using. One solution might be to use Maven where you have a central location of your libraries (Maven Central) or a company repository Manager.
Upvotes: 1