简体   繁体   中英

Multi module (multi scm) gradle project development

I've inherited a project with following setup. There are about 5 separate modules in Gradle in 5 different git repositories. The versioning of these modules is driven by ScmVersion plugin. One of these modules is a resulting app that integrates those together.

Dependencies between modules are specified in the build.gradle dependency section by a groupId, an artificatId and a version.

App (separete git repo)
- depends on libA
- depends on libB
- depends on libC

LibA (separete git repo)

LibB (separete git repo)
- depends on LibD

LibC (separete git repo)
- depends on LibD

LibD (separete git repo)

I'm quite new to Gradle. So far, I've created a simple script that overrides the scmVersion of every lib to a timestamped snapshot, and runs "clean build publishToMavenLocal". In the gradle.properites of App, LibB and LibC the script overwrites dependency version to those just built snapshots and runs the same tasks (at the end of the script this gets reverted back to RELEASE versions). This effectively builds the whole structure of the project as it is on my machine.

My question is, how can I effectively develop this locally? I'm using Intellij. I've seen some examples of multi project setups with nested modules but how can I also keep it working in the current CI setup where the jobs treat dependencies between these as regular group-artifactId-version dependencies?

Many thanks for any input.

PS Before leaving colleague mentioned that the Eclipse Gradle plugin can somehow handle that. Do you have any experience with that please?

We'll probably resolve this using Gradle composite build feature (also integrated to Intellij in version 2016.3). Unfortunately, nested composite builds are not supported by Gradle :(

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM