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.

4.0.0

com.mycompany.enterprise.fusion.maven

master

pom

Maven master project

1.0

…/P1-maven-plugin

…/P2-maven-plugin

…/P3-maven-plugin

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.