[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: Multiple classpath options?

Joe Zulli wrote:
Hi everyone,
I have a pretty interesting problem with classpaths and I'm wondering if there is a solution available that will allow me to achieve what I want using Eclipse as is, or if it's possible to write a plugin. Here's my scenario:


-- The company I work for uses both Eclipse and Maven for development. We have probably around 20 Eclipse projects with intricate dependencies. Some projects represent end-applications/web sites, and some represent shared libraries and utilities. -- Within the company there are different levels of access rights in the codebase. Some users have access to all projects, while others (contractors, for instance) only have access to the end-application projects. This access is controlled by our SCM tool.
-- In the .classpath files for the end appications, there are no project dependencies, but rather use referenced jars for the shared libraries. This allows the users with limited access to compile and run the end applications with ease.
-- The users with full access are a little less lucky. Since they want to use dependent projects instead of the jars (for purposes of debugging into the code and making changes that span into both end applications and shared components), they have to constantly change the project properties. This puts the project out of sync with the repository, which is a pain to say the least. Sometimes these modified .classpath files accidentially get checked in, which breaks things for the users with limited access. It's a huge mess!

Hmm, definitely not your run-of-the-mill setup, and a bit challenging.
Here's one idea that I have not actually tried but might work out:
Create a "Dependencies" project that has nothing in it but the shared library JARs. Set it up with two branches in your SCM; one branch will have a .classpath that points to the JARs, the other branch points to the Projects instead. Make sure to set up the Order and Export tab of Java Build Path for that project.
Then your other projects (applications) can depend on the Dependencies project; they will either depend on the JARs or the their projects, depending on which branch of Dependencies you have. Hopefully your SCM tool can control access to different branches and different users.
Of course this means that updates to the dependencies (like adding a new library) will have to be done on both branches of Dependencies, but I doubt that will be much a burden.


Another idea would be to NOT check .classpath in, but rather have another process for distributing the right version to the right people (shared file system, email, etc). The drawback there is that whenever it changes, everyone has to be told to update their copy.

Hope this helps,
	Eric