[#17] feat: 멀티 프로젝트 구성
- 인증 api 적용 전 기존 프로젝트 멀티프로젝트로 전환 - common(entity관련), service-api로 구성
This commit is contained in:
79
build.gradle
79
build.gradle
@@ -1,79 +0,0 @@
|
||||
buildscript {
|
||||
ext {
|
||||
springBootVersion = '2.7.0'
|
||||
dependencyManagementVersion = '1.0.11.RELEASE'
|
||||
kotlinVersion = '1.6.21'
|
||||
flywayVersion = '7.15.0'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
|
||||
classpath "io.spring.gradle:dependency-management-plugin:${dependencyManagementVersion}"
|
||||
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
||||
classpath "org.jetbrains.kotlin:kotlin-noarg:${kotlinVersion}"
|
||||
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'kotlin-spring'
|
||||
apply plugin: "kotlin-jpa"
|
||||
apply plugin: "kotlin-noarg"
|
||||
apply plugin: "kotlin-allopen"
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
group = 'io.beaniejoy.dongecafe'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
sourceCompatibility = '17'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
allOpen {
|
||||
annotation("javax.persistence.Entity")
|
||||
annotation("javax.persistence.MappedSuperclass")
|
||||
annotation("javax.persistence.Embeddable")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
|
||||
implementation('io.github.microutils:kotlin-logging:2.1.21')
|
||||
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
|
||||
// log4j2
|
||||
// implementation 'org.springframework.boot:spring-boot-starter-log4j2'
|
||||
// testImplementation 'org.springframework.boot:spring-boot-starter-log4j2'
|
||||
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
|
||||
runtimeOnly 'mysql:mysql-connector-java' // MySQL
|
||||
runtimeOnly 'com.h2database:h2' // H2
|
||||
|
||||
implementation "org.flywaydb:flyway-core:${flywayVersion}" // flyway
|
||||
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
}
|
||||
|
||||
//configurations {
|
||||
// all {
|
||||
// // log4j2 적용을 위해 기존 spring boot에서 제공하는 logging exclude
|
||||
// exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
|
||||
// }
|
||||
//}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
93
build.gradle.kts
Normal file
93
build.gradle.kts
Normal file
@@ -0,0 +1,93 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("org.springframework.boot") version "2.7.0"
|
||||
id("io.spring.dependency-management") version "1.0.11.RELEASE"
|
||||
kotlin("jvm") version "1.6.21"
|
||||
kotlin("plugin.spring") version "1.6.21" apply false
|
||||
kotlin("plugin.jpa") version "1.6.21" apply false
|
||||
}
|
||||
|
||||
java.sourceCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
allprojects {
|
||||
group = "io.beaniejoy.dongecafe"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
|
||||
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")
|
||||
apply(plugin = "kotlin-jpa")
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
// configurations {
|
||||
// all {
|
||||
// // log4j2 적용을 위해 기존 spring boot에서 제공하는 logging exclude
|
||||
// exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
|
||||
// }
|
||||
// }
|
||||
|
||||
dependencies {
|
||||
// Spring Boot Project
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
|
||||
//kotlin
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
|
||||
// DB
|
||||
runtimeOnly("mysql:mysql-connector-java") // MySQL
|
||||
runtimeOnly("com.h2database:h2") // H2
|
||||
|
||||
// Logging
|
||||
// log4j2
|
||||
// implementation("org.springframework.boot:spring-boot-starter-log4j2")
|
||||
// testImplementation("org.springframework.boot:spring-boot-starter-log4j2")
|
||||
implementation("io.github.microutils:kotlin-logging:2.1.21")
|
||||
|
||||
implementation("org.flywaydb:flyway-core:7.15.0") // flyway
|
||||
|
||||
// Test
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "17"
|
||||
targetCompatibility = "17"
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf("-Xjsr305=strict")
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
}
|
||||
19
dongne-common/build.gradle.kts
Normal file
19
dongne-common/build.gradle.kts
Normal file
@@ -0,0 +1,19 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
val jar: Jar by tasks
|
||||
val bootJar: BootJar by tasks
|
||||
|
||||
bootJar.enabled = false
|
||||
jar.enabled = true
|
||||
|
||||
allOpen {
|
||||
annotation("javax.persistence.Entity")
|
||||
annotation("javax.persistence.Embeddable")
|
||||
annotation("javax.persistence.MappedSuperclass")
|
||||
}
|
||||
|
||||
noArg {
|
||||
annotation("javax.persistence.Entity")
|
||||
annotation("javax.persistence.Embeddable")
|
||||
annotation("javax.persistence.MappedSuperclass")
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package io.beaniejoy.dongnecafe.common.entity
|
||||
package io.beaniejoy.dongnecafe.common
|
||||
|
||||
import org.springframework.data.annotation.CreatedBy
|
||||
import org.springframework.data.annotation.CreatedDate
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.beaniejoy.dongnecafe.domain.cafe.entity
|
||||
|
||||
import io.beaniejoy.dongnecafe.common.entity.BaseTimeEntity
|
||||
import io.beaniejoy.dongnecafe.common.BaseTimeEntity
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.CafeMenuRegisterRequest
|
||||
import javax.persistence.*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.beaniejoy.dongnecafe.domain.cafe.entity
|
||||
|
||||
import io.beaniejoy.dongnecafe.common.entity.BaseTimeEntity
|
||||
import io.beaniejoy.dongnecafe.common.BaseTimeEntity
|
||||
import javax.persistence.*
|
||||
|
||||
@Entity
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.beaniejoy.dongnecafe.domain.cafe.entity
|
||||
|
||||
import io.beaniejoy.dongnecafe.common.entity.BaseTimeEntity
|
||||
import io.beaniejoy.dongnecafe.common.BaseTimeEntity
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.MenuOptionRegisterRequest
|
||||
import java.math.BigDecimal
|
||||
import javax.persistence.*
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.beaniejoy.dongnecafe.domain.cafe.entity
|
||||
|
||||
import io.beaniejoy.dongnecafe.common.entity.BaseTimeEntity
|
||||
import io.beaniejoy.dongnecafe.common.BaseTimeEntity
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.OptionDetailRegisterRequest
|
||||
import javax.persistence.*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.beaniejoy.dongnecafe.domain.cafe.entity
|
||||
|
||||
import io.beaniejoy.dongnecafe.common.entity.BaseTimeEntity
|
||||
import io.beaniejoy.dongnecafe.common.BaseTimeEntity
|
||||
import java.math.BigDecimal
|
||||
import javax.persistence.*
|
||||
|
||||
3
dongne-service-api/build.gradle.kts
Normal file
3
dongne-service-api/build.gradle.kts
Normal file
@@ -0,0 +1,3 @@
|
||||
dependencies {
|
||||
implementation(project(":dongne-common"))
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.runApplication
|
||||
|
||||
@SpringBootApplication
|
||||
class DongneCafeApiApplication
|
||||
class DongneCafeServiceApiApplication
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
runApplication<DongneCafeApiApplication>(*args)
|
||||
runApplication<DongneCafeServiceApiApplication>(*args)
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import org.junit.jupiter.api.Test
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
|
||||
@SpringBootTest
|
||||
internal class DongneCafeSirenOrderApplicationTests {
|
||||
internal class DongneCafeServiceApiApplicationTests {
|
||||
|
||||
@Test
|
||||
fun contextLoads() {
|
||||
@@ -1,6 +1,8 @@
|
||||
package io.beaniejoy.dongnecafe.domain.cafe.service
|
||||
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.*
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.CafeMenuUpdateRequest
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.MenuOptionUpdateRequest
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.OptionDetailUpdateRequest
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.utils.CafeTestUtils
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
@@ -1,15 +1,8 @@
|
||||
package io.beaniejoy.dongnecafe.domain.cafe.utils
|
||||
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.CafeRegisterRequest
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.CafeMenuRegisterRequest
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.MenuOptionRegisterRequest
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.model.request.OptionDetailRegisterRequest
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.entity.Cafe
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.entity.CafeMenu
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.entity.MenuOption
|
||||
import io.beaniejoy.dongnecafe.domain.cafe.entity.OptionDetail
|
||||
import org.junit.jupiter.api.Assertions.*
|
||||
import java.math.BigDecimal
|
||||
import javax.persistence.GeneratedValue
|
||||
|
||||
class CafeTestUtils {
|
||||
@@ -1 +0,0 @@
|
||||
rootProject.name = 'dongne-cafe-api'
|
||||
3
settings.gradle.kts
Normal file
3
settings.gradle.kts
Normal file
@@ -0,0 +1,3 @@
|
||||
rootProject.name = "dongne-cafe-api"
|
||||
include("dongne-common")
|
||||
include("dongne-service-api")
|
||||
Reference in New Issue
Block a user