I am creating a subproject project with several subprojects. The subprojects for each have their own separate git repositories and should be included in the superproject using git submodules. Our preferred case would be that our continuous integration tool (Jenkins) would independently build these subprojects in .jars, not taking into account or not knowing about the superproject.
This can be done quite easily by simply making sure that each of the subprojects has build.gradle, which has all the information needed for the .jar assembly that arises from the assembly. The only complication that arises when some subprojects depend on other subprojects.
Even this is pretty simple if you always want subprojects to pull their ".jars" dependencies from the Maven or Ivy repository. However, when we build our local mailboxes during the development process, we want to be able to create and deploy a super project .war file for Tomcat and all .jars somewhere in the class path and ensure that all .jars are built from a copy of the code that Now located in our own box. (That is, we want it to act basically as if we were using compile (project (": otherproject")) rather than compiling ("group: otherproject: 1.0-SNAPSHOT") or some of them.)
I am new to Gradle, and it is possible that I am missing something quite obvious, but I have not yet found a good way to handle this.
We could do something so that the set of dependencies for building it by pulling .jars from our Maven repository is in one file and the set of dependencies for building it using its sibling subprojects in another file, but this looks like a Dry Break. (In this case, we would have two separate places to manage the dependency list.)
We could create subproject assembly scripts to always fetch Maven from the repository and have a superproject script design to include sections for each subproject that redefine the dependencies in the subprojects, but this is equivalent to a DRY violation as the previous option.
I thought that it is possible that the superproject really inherits and modifies the dependency lists on each of the subprojects as necessary (the code in the superproject must have access to all the information necessary to convert the dependency on the Maven artifact into the corresponding dependency on the sibling subproject, I would have thought), but, having studied it quite a bit, I'm not sure how this could be done.
I hope you people can help. Thanks!