Resolve in workspace

Some projects are composed of mulpliple modules. Often, these modules have dependencies between them, dependencies managed by Ivy (of course!).

Eclipse is capable of calculating the workspace's build order according to dependencies between projects. To leverage this advantage, IvyDE has the ability to add a project reference to a dependency located in the workspace in place of downloading its published artifact(s) from the repository. In this way, developers can develop multi-module applications, and test the interaction between these modules, before building and publishing artifacts to the repository.

Consider a multi-module application with a considerable amount of code in each of several projects. Many developers have experienced the delays involved in waiting for Eclipse to build code across all of these projects even though development is only being conducted in one isolated part of the application (maybe just one or two projects). If the latest published artifact in the Ivy repository has the same source code as a module that the developer is not currently working on, simply closing that project in the Eclipse workspace and resolving dependencies on dependent projects that would resolve that artifact speeds the compilation process considerably.

First, each application module should be separate a project in Eclipse, and each of these projects should have a configured IvyDE classpath container.

To enable resolution in the workspace, go to the advanced configuration panel of the classpath container and select Resolve dependencies in workspace.

Important notes: to make the resolve in workspace work correctly the info in the ivy.xml should be properly set:
  • The org and name
  • If there is a rev specified, dependencies should specify the appropriate range
  • If there is no rev specified, only dependencies with lastest will match
  • The status should match the required one: a dependency with latest.integration will only match if there is status="interation" in the info of the dependant module
Having two projects "A" and "B" configured to use IvyDE and the workspace resolver, here is the expected resolved dependencies:
A dependency on BB declared revisionresult
latest.integration1.2B wired on A
1.21.2B wired on A
[1.2,1.3)1.2B wired on A
1.01.2no project wiring
latest.integrationnoneB wired on A
1.2noneB wired on A
[1.2,1.3)noneB wired on A
latest.integration$versionno project wiring
1.2$versionno project wiring
[1.2,1.3)$versionno project wiring

Printer Friendly