Build Multi-Module maven2 script with one gradle script?

(Don Eytel) #1

Hello Everyone,

I am new to Gradle. I have a old maven2 project that build fine. I want to convert it to gradle. It is made up of multi-modules.

The project layout looks like this master- pom.xml | P1-pom.xml | P2-pom.xml | P3-pom.xml

The master project looks something like this.





Maven master project





I am wondering what would my build.gradle script look like to so the master project will drive the build of the other projects?

I am able to create in each the project P1, P2, P3 there own build.gradle files and they build fine. What I would like to do is have one build.gradle script and build them all. An ideal on how this can be done?

Thanks, Don

(Peter Niederwieser) #2

Basically it goes like this:

allprojects { ... }
  subprojects { ... }
  project(":foo") { ... }
  project(":bar") { ... }

The Gradle User Guide has the details. For a large real-world example, see the Spring Framework.