Skip to content

Commit d08e1d8

Browse files
committed
Settings : 멀티 모듈 설정
- core, api, admin, batch - root, core에 공통 사용될 의존성 추가 - batch : 배치 관련 의존성 추가 - admin : core, api 의존성 추가
1 parent 33f1903 commit d08e1d8

File tree

19 files changed

+631
-58
lines changed

19 files changed

+631
-58
lines changed

build.gradle

+114-42
Original file line numberDiff line numberDiff line change
@@ -6,89 +6,161 @@ plugins {
66
id 'org.asciidoctor.jvm.convert' version '3.3.2'
77
}
88

9-
allprojects {
9+
repositories {
10+
mavenCentral()
11+
}
12+
13+
subprojects {
14+
apply plugin: 'java'
15+
apply plugin: 'idea'
16+
apply plugin: 'io.spring.dependency-management'
17+
apply plugin: 'org.springframework.boot'
18+
// apply plugin: 'org.asciidoctor.jvm.convert'
19+
1020
group = 'org.fastcampus'
1121
version = '0.0.1-SNAPSHOT'
12-
sourceCompatibility = '17'
1322

14-
repositories {
15-
mavenCentral()
23+
java {
24+
sourceCompatibility = '17'
25+
targetCompatibility = '17'
1626
}
1727

18-
}
28+
compileJava.options.encoding = 'UTF-8'
1929

20-
configurations {
21-
compileOnly {
22-
extendsFrom annotationProcessor
30+
configurations {
31+
compileOnly {
32+
extendsFrom annotationProcessor
33+
}
2334
}
24-
}
2535

26-
subprojects { // 각 모듈에 적용할 공통 설정
27-
apply plugin: 'java'
28-
apply plugin: 'org.springframework.boot'
29-
apply plugin: 'io.spring.dependency-management'
30-
apply plugin: 'org.asciidoctor.jvm.convert'
36+
repositories {
37+
mavenCentral()
38+
}
3139

3240
dependencies {
33-
compileOnly 'org.projectlombok:lombok'
34-
annotationProcessor 'org.projectlombok:lombok'
41+
implementation platform('org.springframework.boot:spring-boot-dependencies:3.1.6')
3542

36-
//spring boot starter
43+
//boot start
44+
implementation 'org.springframework.boot:spring-boot-starter'
45+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
46+
developmentOnly 'org.springframework.boot:spring-boot-devtools'
3747

38-
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
3948
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
40-
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
41-
//security 임시 제거
42-
// implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
43-
// implementation 'org.springframework.boot:spring-boot-starter-security'
44-
implementation 'org.springframework.boot:spring-boot-starter-validation'
45-
implementation 'org.springframework.boot:spring-boot-starter-web'
4649
testImplementation 'org.springframework.boot:spring-boot-starter-test'
4750

51+
//jakarta.xml.bind
52+
implementation 'jakarta.xml.bind:jakarta.xml.bind-api-parent:4.0.0'
53+
54+
//swagger
55+
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
56+
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:2.2.0'
57+
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.2.0'
58+
implementation 'org.springdoc:springdoc-openapi-starter-webflux-api:2.2.0'
59+
60+
//validation
61+
implementation 'org.springframework.boot:spring-boot-starter-validation'
62+
63+
testImplementation 'io.projectreactor:reactor-test'
64+
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
65+
4866
//flyway
67+
// implementation 'org.flywaydb:flyway-mysql'
4968
// implementation 'org.flywaydb:flyway-core'
50-
developmentOnly 'org.springframework.boot:spring-boot-devtools'
5169

52-
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
53-
// testImplementation 'org.springframework.security:spring-security-test'
5470

55-
runtimeOnly 'com.h2database:h2'
56-
runtimeOnly 'com.mysql:mysql-connector-j'
71+
//lombok
72+
compileOnly 'org.projectlombok:lombok'
73+
annotationProcessor 'org.projectlombok:lombok'
74+
75+
//Security
76+
// implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
77+
// implementation 'org.springframework.boot:spring-boot-starter-security'
78+
// testImplementation 'org.springframework.security:spring-security-test'
79+
80+
// junit5
81+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.2")
82+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.2")
83+
testImplementation("org.junit.jupiter:junit-jupiter-params:5.6.2")
84+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-params:5.6.2")
85+
86+
//m1 mac unable load solved
87+
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.68.Final:osx-aarch_64'
88+
}
89+
90+
test {
91+
useJUnitPlatform()
5792
}
5893

94+
tasks.named('bootBuildImage') {
95+
builder = 'paketobuildpacks/builder-jammy-base:latest'
96+
}
97+
}
98+
99+
project(':orury-core') {
59100
tasks.named('bootJar') { //빌드할 때 bootjar 파일로 하겠다는 의미
60101
enabled = false
61102
}
62103

63104
tasks.named('jar') { //빌드할 때 jar 파일로 하겠다는 의미
64-
enabled = false
105+
enabled = true
65106
}
66107

67-
tasks.named('test') {
68-
useJUnitPlatform()
108+
dependencies {
109+
//db
110+
runtimeOnly 'com.h2database:h2'
111+
runtimeOnly 'com.mysql:mysql-connector-j'
112+
113+
//Spring-Web
114+
implementation 'org.springframework.boot:spring-boot-starter-web'
115+
116+
//Jdbc, Jpa
117+
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
118+
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
69119
}
70120
}
71121

72122
project(':orury-api') {
73-
dependencies {
123+
tasks.named('bootJar') { //빌드할 때 bootjar 파일로 하겠다는 의미
124+
enabled = true
125+
}
74126

127+
tasks.named('jar') { //빌드할 때 jar 파일로 하겠다는 의미
128+
enabled = false
75129
}
76-
}
77-
project(':orury-batch') {
130+
78131
dependencies {
79-
implementation 'org.springframework.boot:spring-boot-starter-batch'
80-
testImplementation 'org.springframework.batch:spring-batch-test'
132+
implementation project(':orury-core')
133+
//SSE setting
134+
implementation 'org.springframework.boot:spring-boot-starter-webflux'
81135
}
82136
}
83-
project(':orury-admin') {
84-
bootJar {
137+
138+
project('orury-admin') {
139+
tasks.named('bootJar') { //빌드할 때 bootjar 파일로 하겠다는 의미
140+
enabled = true
141+
}
142+
143+
tasks.named('jar') { //빌드할 때 jar 파일로 하겠다는 의미
85144
enabled = false
86145
}
87146

88-
jar {
147+
dependencies {
148+
implementation project(':orury-core')
149+
implementation project(':orury-api')
150+
}
151+
}
152+
project(':orury-batch') {
153+
tasks.named('bootJar') { //빌드할 때 bootjar 파일로 하겠다는 의미
89154
enabled = true
90155
}
156+
157+
tasks.named('jar') { //빌드할 때 jar 파일로 하겠다는 의미
158+
enabled = false
159+
}
160+
91161
dependencies {
92-
implementation project(':orury-api')
162+
implementation project(':orury-core')
163+
implementation 'org.springframework.boot:spring-boot-starter-batch'
164+
testImplementation 'org.springframework.batch:spring-batch-test'
93165
}
94-
}
166+
}

gradle/wrapper/gradle-wrapper.jar

19.4 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+8-9
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8887

8988
# Use the maximum available, or set MAX_FD != -1 to use that value.
9089
MAX_FD=maximum
@@ -145,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145144
case $MAX_FD in #(
146145
max*)
147146
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC2039,SC3045
147+
# shellcheck disable=SC3045
149148
MAX_FD=$( ulimit -H -n ) ||
150149
warn "Could not query maximum file descriptor limit"
151150
esac
152151
case $MAX_FD in #(
153152
'' | soft) :;; #(
154153
*)
155154
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC2039,SC3045
155+
# shellcheck disable=SC3045
157156
ulimit -n "$MAX_FD" ||
158157
warn "Could not set maximum file descriptor limit to $MAX_FD"
159158
esac
@@ -202,11 +201,11 @@ fi
202201
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203202
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204203

205-
# Collect all arguments for the java command:
206-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207-
# and any embedded shellness will be escaped.
208-
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209-
# treated as '${Hostname}' itself on the command line.
204+
# Collect all arguments for the java command;
205+
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
206+
# shell script including quotes and variable substitutions, so put them in
207+
# double quotes to make sure that they get re-expanded; and
208+
# * put everything else in single quotes, so that it's not re-expanded.
210209

211210
set -- \
212211
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package org.fastcampus.oruryadmin;
22

3+
34
import org.springframework.boot.SpringApplication;
45
import org.springframework.boot.autoconfigure.SpringBootApplication;
56

67
@SpringBootApplication
78
public class OruryAdminApplication {
8-
99
public static void main(String[] args) {
1010
SpringApplication.run(OruryAdminApplication.class, args);
1111
}
12-
1312
}

orury-admin/src/main/resources/application.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ spring:
1717
application.name: orury-api
1818
datasource:
1919
url: ${LOCAL_DB_NAME}
20-
username: ${LOCAL_USER_NAME}
21-
password: ${LOCAL_USER_PASSWORD}
20+
username: ${LOCAL_DB_USER_NAME}
21+
password: ${LOCAL_DB_USER_PASSWORD}
2222
jpa:
2323
open-in-view: false
2424
defer-datasource-initialization: true

orury-api/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dependencies {
22

3+
implementation 'org.springframework.boot:spring-boot-starter-web'
34
}

orury-api/settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.name = 'orury-api'
1+
rootProject.name = 'orury-api'

orury-core/.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
HELP.md
2+
.gradle
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
!**/src/main/**/build/
6+
!**/src/test/**/build/
7+
8+
### STS ###
9+
.apt_generated
10+
.classpath
11+
.factorypath
12+
.project
13+
.settings
14+
.springBeans
15+
.sts4-cache
16+
bin/
17+
!**/src/main/**/bin/
18+
!**/src/test/**/bin/
19+
20+
### IntelliJ IDEA ###
21+
.idea
22+
*.iws
23+
*.iml
24+
*.ipr
25+
out/
26+
!**/src/main/**/out/
27+
!**/src/test/**/out/
28+
29+
### NetBeans ###
30+
/nbproject/private/
31+
/nbbuild/
32+
/dist/
33+
/nbdist/
34+
/.nb-gradle/
35+
36+
### VS Code ###
37+
.vscode/

orury-core/build.gradle

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//build.gradle 파일
2+
3+
//plugins {
4+
// id 'java'
5+
// id 'org.springframework.boot' version '3.1.6'
6+
// id 'io.spring.dependency-management' version '1.1.4'
7+
// id 'org.asciidoctor.jvm.convert' version '3.3.2'
8+
//}
9+
//
10+
//tasks.named('bootJar') { //빌드할 때 bootjar 파일로 하겠다는 의미
11+
// enabled = false
12+
//}
13+
//dependencies {
14+
//
15+
//
16+
//}
42.4 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)