Gradle build and deploy war to different servers


(Konstantin Petrukhnov) #1

I have java project, that should be deployed to tens of locations (war, each with some customization). What would be correct way do it with gradle? Goal is to make build for each server separately using same src code.

I’m thinking to have 2 projects (2 git repos):

One with src code.

Second with multiple folders like:

Root
|__ servers
|
 |_ srv1
|
 |
 |_ src/main/resource
|
 |
     |_ properties.properties
|
 |
     |_ log.xml
|
 |_ srv2
|
     |_ src/main/resource
|
         |_ properties.properties
|
         |_ log.xml
|__ build.gradle

Each server will have 3 to 10 resource files. E.g. make each server as module, and have parent task that assemble war and replace files in it. In server gradle, there could be task for deploying (as deploy only possible to some servers).