Skip to content

Commit

Permalink
Merge pull request #91 from team-nabi/NO-JIRA--refactor--migration
Browse files Browse the repository at this point in the history
NO-JIRA--refactor : mono repo -> multi module migration
  • Loading branch information
BeommoKoo-dev authored Jan 9, 2024
2 parents dd1dec4 + bac4667 commit 3fd0f09
Show file tree
Hide file tree
Showing 238 changed files with 2,500 additions and 1,979 deletions.
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,14 @@ gradle-app.setting
# Java heap dump
*.hprof

src/main/resources/application-test.yml
src/main/resources/application-prod.yml
src/main/resources/application-local.yml
src/main/resources/application-jwt.yml
src/main/resources/application-dev.yml
src/main/resources/firebase/*
nabimarket-api/src/main/resources/application-test.yml
nabimarket-api/src/main/resources/application-prod.yml
nabimarket-api/src/main/resources/application-local.yml
nabimarket-api/src/main/resources/application-jwt.yml
nabimarket-api/src/main/resources/application-dev.yml
nabimarket-api/src/main/resources/firebase/*

*.yml
!nabimarket-api/src/main/resources/application.yml

# End of https://www.toptal.com/developers/gitignore/api/macos,java,gradle,intellij
145 changes: 64 additions & 81 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,108 +1,91 @@
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.17'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
}

// SNAPSHOT-plain 생성 막기위함
jar {
enabled = false
}

group = 'org.prgrms'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
id 'io.spring.dependency-management' version '1.1.3'
id 'java-library'
}

repositories {
mavenCentral()
}

dependencies {
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'
implementation 'org.springframework.retry:spring-retry'
implementation 'org.springframework:spring-aspects'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.15'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'com.auth0:java-jwt:4.4.0'
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.0'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

testCompileOnly 'org.projectlombok:lombok'
testCompileOnly 'com.mysql:mysql-connector-j'
testAnnotationProcessor 'org.projectlombok:lombok'

runtimeOnly 'com.mysql:mysql-connector-j'

testImplementation 'org.springframework.security:spring-security-test'

// querydsl 추가
implementation "com.querydsl:querydsl-jpa:5.0.0"
implementation "com.querydsl:querydsl-apt:5.0.0"

testImplementation 'org.springframework.boot:spring-boot-starter-test'
// 각 모듈에 적용할 공통 설정
subprojects {
group = 'org.prgrms'
version = '0.0.1-SNAPSHOT'

// Json을 결과로 매핑하기 위한 의존성
implementation 'com.google.code.gson:gson:2.8.8'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java-library'

implementation 'org.springframework.boot:spring-boot-starter-freemarker:2.5.4'
java {
sourceCompatibility = '17'
}

// 다국어 제공을 위한 i18n을 yml 파일로 적용하기 위한 의존성
implementation 'net.rakugakibox.util:yaml-resource-bundle:1.1'
repositories {
mavenCentral()
}

// jwt 의존성 - JWT의 생성 및 유효성 검사와 관련된 기본적인 기능
implementation 'io.jsonwebtoken:jjwt:0.9.1'
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

//Spring-Cloud-AWS
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
// web
implementation 'org.springframework.boot:spring-boot-starter-web'

// redisson
implementation "org.redisson:redisson-spring-boot-starter:3.21.1"
// testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
// testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// gradle 빌드시에는 각 프로젝트를 실행가능한 jar형태로 만들게 되는데, module-common 프로젝트의 경우 main메소드가 없음
// 단순히 참조용 클래스들만 있는 프로젝트를 위해 아래와 같은 설정(bootJar, jar)들을 추가함
bootJar {
enabled = false
}
jar {
enabled = true
}

// Google Firebase Control Message
implementation 'com.google.firebase:firebase-admin:9.1.1'
test {
useJUnitPlatform()
}
}

// Qtype 생성 경로
def querydslDir = "$buildDir/generated/querydsl"
querydsl {
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets {
main.java.srcDir querydslDir
// 하위 프로젝트간의 의존성을 관리
project(':nabimarket-api') {
dependencies {
implementation project(':nabimarket-common')
implementation project(':nabimarket-application')
implementation project(':nabimarket-infra')
}
}
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl

project(':nabimarket-application') {
dependencies {
implementation project(':nabimarket-domain')
implementation project(':nabimarket-common')
implementation project(':nabimarket-infra')
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor

project(':nabimarket-domain') {
dependencies {
implementation project(':nabimarket-common')
}
querydsl.extendsFrom compileClasspath
}

test {
useJUnitPlatform()
project(':nabimarket-infra') {
dependencies {
implementation project(':nabimarket-common')
implementation project(':nabimarket-domain')
}
}

tasks.named('test') {
useJUnitPlatform()
wrapper {
gradleVersion = '8.3'
distributionUrl = distributionUrl.replace("bin", "all")
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 1 addition & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
31 changes: 8 additions & 23 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,11 +80,13 @@ do
esac
done

# This is normally unused
# shellcheck disable=SC2034
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -131,29 +133,22 @@ location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,10 +193,6 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand All @@ -214,12 +205,6 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 6 additions & 9 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%"=="" @echo off
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,8 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -41,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -76,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
13 changes: 13 additions & 0 deletions nabimarket-api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* API
*/
dependencies {
// // retry
// implementation 'org.springframework.retry:spring-retry'

// swagger
implementation 'org.springdoc:springdoc-openapi-ui:1.6.15'

// security
implementation 'org.springframework.boot:spring-boot-starter-security'
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package org.prgrms.nabimarketbe;

import java.util.TimeZone;

import javax.annotation.PostConstruct;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

@EnableRetry
@EnableJpaAuditing
@EnableScheduling
@SpringBootApplication
public class NabiMarketBeApplication {
Expand Down
Loading

0 comments on commit 3fd0f09

Please sign in to comment.