[NO-ISSUE] Initialize multi-module project

This commit is contained in:
woozu.shin 2022-09-21 21:21:48 +09:00
parent 2c58a5d1f9
commit b4494837f5
15 changed files with 196 additions and 75 deletions

View File

@ -1,19 +1,7 @@
plugins {
id("java")
}
group = "com.kakaoent.adp.adserver"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}

View File

@ -1,14 +0,0 @@
package com.kakaoent.adp.adserver;
/**
* ${NAME}
*
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since ${YEAR}-${MONTH}-${DAY}
*/
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

View File

@ -0,0 +1,18 @@
package com.kakaoent.adp.adserver.api
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
import org.springframework.boot.runApplication
/**
* ApiApplication
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since 2022-09-21
*
*/
@SpringBootApplication(exclude = [DataSourceAutoConfiguration::class])
class ApiApplication
fun main(args: Array<String>) {
runApplication<ApiApplication>(*args)
}

View File

@ -0,0 +1,10 @@
package com.kakaoent.adp.adserver.api.configuration
/**
* ApiApplicationConfiguration
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since 2022-09-21
*
*/
class ApiApplicationConfiguration {
}

View File

@ -0,0 +1,14 @@
package com.kakaoent.adp.adserver.api.constant
import com.kakaoent.adp.adserver.support.constant.EmptyEnum
/**
* EmptyConstant
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since 2022-09-21
*
*/
@JvmField val DEFAULT_EMPTY_ENUM : EmptyEnum = EmptyEnum.A
class EmptyConstant {
}

View File

@ -0,0 +1,11 @@
package com.kakaoent.adp.adserver.api.dto
/**
* EmptyDTO
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since 2022-09-21
*
*/
class EmptyDTO {
}

View File

@ -0,0 +1,10 @@
package com.kakaoent.adp.adserver.api.property
/**
* EmptyProperties
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since 2022-09-21
*
*/
class EmptyProperties {
}

View File

@ -1,22 +1,37 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
id("org.springframework.boot") version "2.7.3"
id("io.spring.dependency-management") version "1.0.13.RELEASE"
kotlin("jvm") version "1.6.21"
kotlin("plugin.spring") version "1.6.21"
kotlin("plugin.jpa") version "1.6.21"
kotlin("plugin.spring") version "1.6.21" apply false
kotlin("plugin.jpa") version "1.6.21" apply false
}
group = "com.kakaoent.adp.adserver"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
}
allprojects {
group = "com.kakaoent.adp.adserver"
version = "0.0.1-SNAPSHOT"
dependencies {
repositories {
mavenCentral()
}
}
subprojects {
apply(plugin = "java")
apply(plugin = "io.spring.dependency-management")
apply(plugin = "org.springframework.boot")
apply(plugin = "org.jetbrains.kotlin.plugin.spring")
apply(plugin = "kotlin")
apply(plugin = "kotlin-spring") //all-open
apply(plugin = "kotlin-jpa")
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
@ -24,15 +39,57 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
runtimeOnly("mysql:mysql-connector-java")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
}
tasks.withType<KotlinCompile> {
dependencyManagement {
imports {
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
}
dependencies {
dependency("net.logstash.logback:logstash-logback-encoder:6.6")
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
//api <- domain, support 의존
project(":api") {
dependencies {
implementation(project(":domain"))
implementation(project(":support"))
}
}
//domain <- support 의존
project(":domain") {
dependencies {
implementation(project(":support"))
}
}
//support
project(":support") {
val jar: Jar by tasks
val bootJar: BootJar by tasks
bootJar.enabled = false
jar.enabled = true
}

20
domain/build.gradle.kts Normal file
View File

@ -0,0 +1,20 @@
plugins {
}
allOpen {
// ref. https://dev-gorany.tistory.com/361
annotation("javax.persistence.Entity")
annotation("javax.persistence.Embeddable")
annotation("javax.persistence.MappedSuperclass")
}
noArg {
annotation("javax.persistence.Entity") // @Entity가 붙은 클래스에 한해서만 no arg 플러그인을 적용
annotation("javax.persistence.Embeddable")
annotation("javax.persistence.MappedSuperclass")
}
dependencies {
}

View File

@ -0,0 +1,10 @@
package com.kakaoent.adp.adserver.domain
/**
* EmptyDomain
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since 2022-09-21
*
*/
class EmptyDomain {
}

View File

@ -1,3 +1,4 @@
rootProject.name = "adp-adserver"
include("api")
include("support")
include("domain")

View File

@ -1,19 +1,5 @@
plugins {
id("java")
}
group = "com.kakaoent.adp.adserver"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}

View File

@ -1,14 +0,0 @@
package com.kakaoent.adp.adserver;
/**
* ${NAME}
*
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since ${YEAR}-${MONTH}-${DAY}
*/
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

View File

@ -0,0 +1,14 @@
package com.kakaoent.adp.adserver.support.constant
/**
* EmptyEnum
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since 2022-09-21
*
*/
enum class EmptyEnum {
A,
B,
C,
;
}

View File

@ -0,0 +1,10 @@
package com.kakaoent.adp.adserver.support.util
/**
* EmptyUtils
* @author Shin Woo-jin (woozu.shin@kakaoent.com)
* @since 2022-09-21
*
*/
class EmptyUtils {
}