Skip to content

Commit

Permalink
chore: configure multi-module project structure
Browse files Browse the repository at this point in the history
chore: configure multi-module project structure
  • Loading branch information
Ji-soo708 authored Nov 19, 2023
2 parents 3f9461e + a9ffbd5 commit 17f1ca9
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 38 deletions.
63 changes: 33 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,48 @@ plugins {
id 'io.spring.dependency-management' version '1.1.3'
}

group = 'com.oing'
version = '0.0.1-SNAPSHOT'
repositories {
mavenCentral()
}

java {
subprojects {
group = 'com.oing'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
}

repositories {
mavenCentral()
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
implementation 'org.springdoc:springdoc-openapi-ui:1.7.0'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
implementation 'org.springdoc:springdoc-openapi-ui:1.7.0'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
tasks.named('bootJar') {
enabled = false
}

tasks.named('bootBuildImage') {
builder = 'paketobuildpacks/builder-jammy-base:latest'
tasks.named('jar') {
enabled = true
}

tasks.named('test') {
Expand Down
28 changes: 28 additions & 0 deletions config/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
plugins {
id 'java'
}

repositories {
mavenCentral()
}

dependencies {
implementation project(':member')

implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
}

tasks.named('bootJar') {
enabled = true
}

tasks.named('jar') {
enabled = true
}

tasks.named('test') {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.oing.server;
package com.oing;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ServerApplication {

public static void main(String[] args) {
SpringApplication.run(ServerApplication.class, args);
}
public static void main(String[] args) {
SpringApplication.run(ServerApplication.class, args);
}

}
19 changes: 19 additions & 0 deletions config/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
spring:
datasource:
url: jdbc:h2:~/oing;MODE=MYSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;
username: sa
jpa:
hibernate:
ddl-auto: update
open-in-view: false
properties:
hibernate:
create_empty_composites:
enabled: true
show_sql: true
format_sql: true
h2:
console:
enabled: true
settings:
web-allow-others: true
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.oing.server;
package com.oing;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class ServerApplicationTests {

@Test
void contextLoads() {
}
@Test
void contextLoads() {
}

}
15 changes: 15 additions & 0 deletions member/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repositories {
mavenCentral()
}

dependencies {

}

tasks.named('bootJar') {
enabled = false
}

tasks.named('jar') {
enabled = true
}
14 changes: 14 additions & 0 deletions member/src/main/java/com/oing/controller/MemberController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.oing.controller;

import com.oing.service.MemberService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class MemberController {

private final MemberService memberService;

}
8 changes: 8 additions & 0 deletions member/src/main/java/com/oing/service/MemberService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.oing.service;

import org.springframework.stereotype.Service;

@Service
public class MemberService {

}
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
rootProject.name = 'server'

include 'config'
include 'member'
Empty file removed src/main/resources/application.yml
Empty file.

0 comments on commit 17f1ca9

Please sign in to comment.