I have this project structure:
-root-project
-settings.gradle
-build.gradle
-subProjectA(spring-boot)
-build.gradle
-subprojectB(spring-boot)
-build.gradle
-subprojectC(spring-boot)
-build.gradle
-commonProject(java library)
-build.gradle
It is simple of my root settings.gradle:
rootProject.name = 'root-project'
include 'subProjectA'
include 'subprojectB'
include 'subprojectC'
include 'commonProject'
It is my root project build.gradle:
group = 'my.domain'
version = '0.0.1-SNAPSHOT'
ext {
springBootVersion = '2.1.3.RELEASE'
cxfVersion = '3.2.7'
uuidGeneratorVersion = '3.1.5'
commonLang3Version = '3.7'
encacheVersion = '2.6.11'
logstashVersion = '5.2'
}
And in each subProject, I have build.gradle
file with these plugins:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'eclipse'
I have duplicate plugins and spring-boot
dependency in each subModule
and I want to move it to a common(root) file. But I don't understand how can I do it.