I would like to use Gradle to build a java project and I would like to structure it as follows.
- Core Library
- Web App (war plugin)
- Server (application plugin)
- Client
- Client War (war plugin)
The Web App, Server, and Client all depend on core. The Server depends on the Web App because it is going to serve it as the admin page using embedded Jetty. The Client War depends on the Client. The Client War is to be deployed to a web server for distribution of the client as a web start application.
What I would like to know is how can I tell the Server project that it depends on the Web App and needs to copy it into the proper location in it's distribution structure. I would also like to know how I can tell the Client War project to depend on the Client project and to copy the Client jar and all of it's dependencies into the proper location to build the war archive.
I plan to use the application plugin for the Server so under <root>/src/dist
there will be a webapp
directory where the one or possibly more web apps will reside. It is expected that the files contained in the webapp
directory will be war files.
This is a new project so it can follow the standard build conventions of Gradle and the project layout expected by Gradle.
Ideally at some point the Client artifacts will be published to an internal Artifactory or Sonatype Nexus repository so that the Client War can be built with version support.
So far I have found the following resources.