Ok, first off, I’ve searched the forum and user-guide thin, and I’ve seen all the suggestions that go like: “Don’t do it like that, refactor it into multiple projects instead”, but that is simply not feasible in my setup (yet).
So, I have this clusterfrak of a legacy project, consisting of a zillion modules, grouped into 3 major projects, with circular dependencies and you-name-it, if it smells, we have it!
But, I’m trying to nudge this into the right decision, and big bang is not gonna cut it.
So, so far I’ve managed to take our “core-project” and hack and slash that from Ant+Makefiles+Bashscripts+Velocity+Java-calling-ant+xsd-over-jasper2… and more into gradle.
So far so good. Now I have a nifty gradle core-gradle project, producing 22 different jars/wars and ears. Some of the jars are for client side, some are for client-side-over-jnlp-needs-signing etc. etc.
Now I need to get another project (in the same multi-project setup) depend on some of the artefacts produced in the core-project.
How do I do that?
It seems:
dependencies {
project (':core)
}
Doesn’t cut it, and stuff like:
dependencies {
files('../core/build/lib/myawesome.jar')
}
Might get me there, but requires hacking and slashing to get the task-dependencies right.
So, how do I express a project-dependency on an output-artefact of another project?
And (more importantly) what is required for it to work?
PS: I have really tried to make the core project correctly declare it’s artefacts (all jars should be added to various properties, like sourceSets.main.outputs and to the archives artefacts.