CodeStation Eclipse Plugin and Working on Multiple Projects Concurrently

Lets say that we have two projects, Project A and Project B, such that Project A depends on Project B. When doing a build of Project A, we need to make sure that B.jar is in the classpath. Very often, as developers, we'll have both Project A and Project B open in our IDE. For this example, let's say Eclipse. In that case, we will configure Eclipse to recognize this dependency between Project A and B. Having Eclipse recognize this dependency is very nice during development because any refactorings will be applied to both projects and we can navigate code between the two project seamlessly. But, having this project based dependency does at least seem to present a bit of a problem when using the CodeStation plugin. Lets take a look at how we can solve this problem.

The problem stems from the fact that the CodeStation plugin retrieved B.jar from CodeStation and added it to the classpath of Project A. So Eclipse, when encountering a class from Project B, will think that the class is supposed to come from B.jar rather than the Project B that is open in Eclipse. So if we are doing active development on our dependency (B), the plugin could cause us problems.

That said, Eclipse only gives the resolved jar file precedence if B.jar is ahead of Project B in the classpath, and we can easily control the order of elements in the classpath. In Project Properties dialog, go to Java Build Path, and then to the "Order and Export" tab. There, just move Project B up to be ahead of the "CodeStation Artifacts".

That's great, but what happens when a given developer stops focusing on the dependency and is exclusively focused on the top level project? If they leave Project B at the top of the classpath, they'll have to constantly update the code of a project they don't care about to stay up to date. With one project it isn't a problem. With a dozen, it is . At this point, just swap the jar file resolved by CodeStation back up the ordering so a simple CodeStation resolve updates all dependencies to the latest in use by the official build.



© 2006-2007 Urbancode, Inc.
Anthill, AnthillPro, and AnthillOS are trademarks of Urbancode, Inc.
All other trademarks are owned by their respective owners.
tel: (216) 858-9000 fax: (216) 858-6902 email:info@urbancode.com