Child pages
  • How to depend on a war-packaged project
Skip to end of metadata
Go to start of metadata

The main pattern for having a project depend on another is as follows:

The above works perfectly, but it would fail to compile if project 'foo' was packaged as war instead of jar. You might solve the problem with

This solves the problem in the compilation task, but fails in the eclipse task, because the generated .classpath would contain an incorrect entry. (This is a bug in the Eclipse task as of 1.4.6). To solve this problem you might do

You interpret this like this: in the compile.with, the first element "project('foo')" is used by the eclipse task to set up the project dependency correctly. The second element is used by the compile task to make foo's classes available. The eclipse.exclude_libs options fixes the bug in the Eclipse task by removing the defective .classpath entry.

If you also want to depend on foo's test classes you might write

that can be made clearer with

  • No labels