I have this Gradle setup with four projects, a parent with three children, where a Java Servlet JSON \'backend\' is built into a war-file, and then a static HTML5 \'frontend
Using this post and ideas from elsewhere I made a github project - https://github.com/istomisgood/WarNode
The local Maven repository (and Gradle's install
task) should only be used when exchanging artifacts with Maven builds. It's not meant to be used for exchanging artifacts between projects of a Gradle build, and installing into the local Maven repository won't happen automatically.
Instead, merger
needs to declare project dependencies on the other two projects. For example:
configurations {
merge
}
dependencies {
merge project(":frontend"), project(":backend")
}
task merge(type: Zip) {
from { configurations.merge.collect { zipTree(it) } }
}
This assumes that frontend
and backend
correctly declare their artifacts. (This may happen automatically, for example if the war
plugin is used.)
You'll find much more on this in the Gradle User Guide, in particular the multi-project builds chapter.