On 5/03/10 11:50 AM, samoht wrote:
When using the JavaPlugin to build project B which depends on project A:

dependencies {
     compile project(':projectA')
}

the classes of project A are accessible from project B as long as project A
is setup to create a jar artifact. When however the WarPlugin is used for
project A, the dependency from Java project B to project A cannot be
resolved anymore. I believe this is because in an war archive the Java
packages are placed under WEB-INF/classes/ whereas in the jar archive they
are placed directly under the archive root.

There is a JIRA issue for this problem: http://jira.codehaus.org/browse/GRADLE-687

So my question more generally would be: How can I tell Gradle where in an
artifact of type zip it can find libraries and classes that should be added
to the archive configuration?

There's a few workarounds.

This simplest is to, in projectA's build script, do something like:

jar.enabled = true
artifacts {
    archives jar
}

This effectively reverses the changes that the war plugin makes which breaks the project dependencies. When we fix the bug you can simply remove the work around from projectA's build script.


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to