Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5bc8819
GETP-323 refactor: 단일 모듈에서 api, domain, persistence, application, inf…
scv1702 Nov 6, 2024
ce558b1
GETP-323 refactor: domain 모듈의 타 모듈에 대한 의존성 제거
scv1702 Nov 6, 2024
bfd0292
GETP-323 refactor: application 모듈의 project 컴포넌트에서 api 모듈에 대한 의존성 제거
scv1702 Nov 6, 2024
c98004c
GETP-323 refactor: application 모듈의 auth 컴포넌트에서 api, persistence 모듈에 대…
scv1702 Nov 6, 2024
bfef60f
GETP-323 refactor: application 모듈의 client 컴포넌트에서 api 모듈에 대한 의존성 제거
scv1702 Nov 6, 2024
4ba4f6f
GETP-323 refactor: application 모듈의 member 컴포넌트에서 api 모듈에 대한 의존성 제거
scv1702 Nov 6, 2024
bc81437
GETP-323 refactor: application 모듈의 like 컴포넌트에서 persistence 모듈에 대한 의존성 제거
scv1702 Nov 6, 2024
4a5b709
GETP-323 refactor: application 모듈의 people 컴포넌트에서 api, persistence 모듈에…
scv1702 Nov 6, 2024
3efc184
GETP-323 refactor: application 모듈의 service term 컴포넌트에서 api 모듈에 대한 의존성 제거
scv1702 Nov 6, 2024
4ee4ace
GETP-323 refactor: application 모듈의 storage 컴포넌트에서 infrastructure 모듈에 …
scv1702 Nov 6, 2024
f8b8f08
GETP-323 refactor: persistence 모듈에서 사용하지 않는 fixture 제거 및 api 모듈에 대한 의…
scv1702 Nov 6, 2024
04936fe
GETP-323 refactor: api 모듈의 fixture 패키지 정리
scv1702 Nov 6, 2024
883e337
GETP-323 rename: docs 파일을 api 모듈의 src 디렉토리 안으로 이동
scv1702 Nov 6, 2024
cfad4f3
GETP-323 refactor: application 모듈의 persistence, api 모듈에 대한 의존성 제거
scv1702 Nov 6, 2024
8ee6207
GETP-323 remove: static 파일 제거
scv1702 Nov 6, 2024
e5bd30b
GETP-323 chore: 모듈 간 의존성 설정 및 Dockerfile이 api 모듈의 빌드 결과를 실행하도록 변경
scv1702 Nov 7, 2024
bc9c15b
GETP-323 remove: 사용하지 않는 유틸 클래스 삭제
scv1702 Nov 7, 2024
51336e8
GETP-323 chore: application.yml을 각 모듈에 대해 분리
scv1702 Nov 7, 2024
c1fc3e3
GETP-323 chore: 테스트 후 테스트 결과를 build/test-results로 수집
scv1702 Nov 7, 2024
998cccf
GETP-323 rename: 테스트 시 자동으로 테스트 환경 설정 인식하도록 설정 파일 이름 변경
scv1702 Nov 7, 2024
26f661c
GETP-323 remove: api 모듈에서 사용하지 않는 static 파일 제거
scv1702 Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 10 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ derby.log
# Gradle artifacts
.gradle
.gradletasknamecache
/build
buildSrc/build
/spring-*/build
/framework-*/build
/integration-tests/build
/src/asciidoc/build
spring-test/test-output/
**/build
**/buildSrc/build
**/spring-*/build
**/framework-*/build
**/integration-tests/build
**/src/asciidoc/build
**/spring-test/test-output/

# Maven artifacts
pom.xml
Expand Down Expand Up @@ -104,9 +104,9 @@ local.sh
.run/

# Static Resources
src/main/resources/static/*
src/test/resources/static/*
./storage
**/src/main/resources/static/docs/*
**/src/main/resources/static/oas/*
storage/*

# Yml File
local-docker-compose.yml
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM openjdk:17-jdk

ARG JAR_FILE=build/libs/*.jar
ARG JAR_FILE=get-p-api/build/libs/*.jar
ADD ${JAR_FILE} app.jar

ENTRYPOINT ["java", "-Duser.timezone=GMT+9", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=dev", "-jar", "/app.jar"]
233 changes: 51 additions & 182 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,208 +1,77 @@
import org.yaml.snakeyaml.DumperOptions
import org.yaml.snakeyaml.Yaml

plugins {
id 'java'
id 'org.springframework.boot' version '3.1.4'
id 'io.spring.dependency-management' version '1.1.3'
id 'org.asciidoctor.jvm.convert' version '4.0.2'
id 'com.epages.restdocs-api-spec' version '0.18.2'
}

group = 'es.princip'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
id 'java-library'
id 'java-test-fixtures'
id 'maven-publish'
}

repositories {
mavenCentral()
}
allprojects {
group = 'es.princip'
version = '0.0.1-SNAPSHOT'

configurations {
compileOnly {
extendsFrom annotationProcessor
repositories {
mavenCentral()
}
asciidoctorExt
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'

// Validation
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.apache.tika:tika-core:2.9.1'

// Jpa
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

// Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'

// Jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'

// Database
runtimeOnly 'com.mysql:mysql-connector-j:9.0.0'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'

// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

// WebSocket
implementation 'org.springframework:spring-websocket:6.0.13'

// QueryDSL
implementation "com.querydsl:querydsl-jpa:5.0.0:jakarta"
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// Mail
implementation 'com.sun.mail:jakarta.mail:2.0.1'
implementation 'org.springframework.boot:spring-boot-starter-mail:3.2.1'

// MapStruct
implementation 'org.mapstruct:mapstruct:1.6.0'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.0'

// AOP
implementation 'org.springframework.boot:spring-boot-starter-aop'

// Test Containers
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:testcontainers:1.19.3'
testImplementation 'org.testcontainers:junit-jupiter:1.19.3'
testImplementation 'org.testcontainers:mysql:1.20.0'

implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.4.0'
testImplementation 'com.epages:restdocs-api-spec-mockmvc:0.18.2'

// Monitoring
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'

// Spring REST Docs
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
}

ext {
snippetsDir = file('build/generated-snippets')
}

test {
outputs.dir snippetsDir
useJUnitPlatform()
}

asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
dependsOn test
sources {
include('**/index.adoc')
subprojects {
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java-library'
apply plugin: 'java-test-fixtures'
apply plugin: 'maven-publish'

java {
sourceCompatibility = '17'
targetCompatibility = '17'
}
baseDirFollowsSourceFile()
}

tasks.register('copyDocument', Copy) {
dependsOn asciidoctor
doFirst {
delete file('src/main/resources/static/docs')
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
from asciidoctor.outputDir
into file('src/main/resources/static/docs')
}

openapi3 {
servers = [
{
url = 'https://api.principes.xyz'
description = '개발 서버'
},
{
url = 'http://localhost:57020'
description = '로컬 서버'
}
]
title = 'GET-P API'
description = 'GET-P API 명세서'
version = '0.1.0'
format = 'yaml'
}
test {
useJUnitPlatform()
}

tasks.register('addSecurityConfig') {
dependsOn('openapi3')
doFirst {
def path = "${openapi3.outputDirectory}/openapi3.yaml"
def yaml = new Yaml()
def file = new File(path)
def data = yaml.load(new InputStreamReader(new FileInputStream(new File(path)), 'UTF-8'))
tasks.register('copyTestResults', Copy) {
from 'build/test-results'
into '../build/test-results'
include '**/*.xml'
}

def components = data?.components ?: [:]
def JWT = [
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT'
]
def security = [[JWT: []]]
def securitySchemas = [JWT: JWT]
test.finalizedBy(copyTestResults)

components.securitySchemes = securitySchemas
data.security = security
dependencies {
// Lombok 라이브러리
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'

def options = new DumperOptions().with {
defaultFlowStyle = DumperOptions.FlowStyle.BLOCK
prettyFlow = true
indent = 2
it
}
def converted = new Yaml(options)
def writer = new OutputStreamWriter(new FileOutputStream(file), 'UTF-8')
// MapStruct 라이브러리
implementation 'org.mapstruct:mapstruct:1.6.0'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.0'

converted.dump(data, writer)
}
}
// Jackson 라이브러리
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1'

tasks.register('copyOas', Copy) {
dependsOn('addSecurityConfig')
doFirst {
delete file('src/main/resources/static/oas')
// 테스트 프레임워크
testImplementation 'org.springframework.boot:spring-boot-starter-test:3.3.5'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
from openapi3.outputDirectory
into file('src/main/resources/static/oas')
}

build {
dependsOn copyDocument
dependsOn copyOas
bootJar {
enabled = false
}

bootJar {
dependsOn copyDocument
dependsOn copyOas
from (asciidoctor.outputDir) {
into 'static/docs'
}
from (openapi3.outputDirectory) {
into 'static/oas'
}
jar {
enabled = true
}
Loading