Multi-module Project 관리
Less than 1 minute
Multi-module Project 관리 관련
Gradle > Snippets
Snippets
목적이 동일한 submodule을 구성한 프로젝트 관리
.
./
settings.gradle
settings.gradle
rootProject.name = "multi-module-project"
include ":project-a"
include ":project-b"
include ":project-c"
include ":project-d"
include ":project-e"
//
// 더 추가 가능
settings.gradle.kts
// TODO: 작성
.
./
build.gradle
build.gradle
subprojects {
afterEvaluate { prj ->
println("name: ${prj.name}\tversion: ${prj.version}\tdescription: ${prj.description}")
task fatJar(type: Jar) {
exclude "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.MF"
manifest {
attributes(
"Implementation-Title": "${prj.name}",
"Implementation-Version": "${prj.version}",
"Implementation-Description": "${prj.description}",
)
archivesBaseName = "${prj.name}"
}
archiveFileName = "${prj.name}-${prj.version}"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
from jar
}
task compileJava.dependsOn clean
// ... 생략 ...
}
project(":project-a") {
group = "my.example.group.a"
version = "1.0.1"
description = "서브프로젝트 A"
}
project(":project-b") {
group = "my.example.group.b"
version = "1.0.2"
description = "서브프로젝트 B"
}
project(":project-c") {
group = "my.example.group.c"
version = "1.0.3"
description = "서브프로젝트 C"
}
project(":project-d") {
group = "my.example.group.d"
version = "1.0.4"
description = "서브프로젝트 D"
}
project(":project-e") {
group = "my.example.group.e"
version = "1.0.5"
description = "서브프로젝트 E"
}
}
build.gradle.kts
// TODO: 작성