SubProjects - Challenge with Specific version and with out specific version

I am having couple of question on Gradle approach for my requirement. Please see below for my source tree . Can some one suggest or give example for each question below. Project A and Project B should produce jars and root project should give me WAR file ProjectBase(RootProject)

build.gradle

ProjectA(SubProject)

build.gradle

ProjectB(SubProject)

build.gradle

Question #1 : How to create WAR for base project with same source tree including files from Subproject? Question #2 : How to create WAR for base project with specific versions of Project A and Project B for EX: can we configure like Project1.0 and ProjectB3:0(assume i have Project A1:20 and Project B : 3.0) while i am preparing for WAR for ProjectBase instead of taking files from source tree for these subjects? Question #3- if i import in to eclipse …can i see them as three separate projects - Import is identifying only base project

  1. You would define project A and B as dependencies. The jars would be copied into the META-INF/lib directory. Like you stated, each project can have its on build file, and you add a settings.gradle to create a mutli-project build.

  2. Yes, you can put any type of conditional logic in the build to select what version of every artifact you use. This can all be decided in the configuration phase of the build.

  3. Yes. by default each sub-project and base proj would create a separate eclipse project/classpath files. The output is also configurable since you have access to the XML object before it is written.