Skip to content

[BE/REFACTOR] build.gradle 파일에서 사용하지 않는 의존성 제거 #636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 26 additions & 100 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
// Querydsl 버전 plugins
buildscript {
ext {
queryDslVersion = "5.0.0"
}
}

plugins {
id 'java'
id 'org.springframework.boot' version '2.7.11'
id 'io.spring.dependency-management' version '1.1.4'
id "org.asciidoctor.jvm.convert" version "3.3.2"
id "me.champeau.jmh" version "0.7.2"
id 'com.diffplug.spotless' version '6.23.3'
id 'org.springframework.boot' version "${springBootVersion}"
id 'io.spring.dependency-management' version "${springDependencyManagementVersion}"
id 'com.diffplug.spotless' version "${spotlessVersion}"
id 'jacoco'
}

group = 'com.gaebaljip'
version = '1.0.0'
group = "${projectGroup}"
version = "${applicationVersion}"

java {
sourceCompatibility = '17'
}

configurations {
asciidoctorExt
compileOnly {
extendsFrom annotationProcessor
}
sourceCompatibility = "${javaVersion}"
}

repositories {
Expand All @@ -41,10 +25,11 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'

// database
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
testImplementation 'org.projectlombok:lombok:1.18.26'
testImplementation 'org.projectlombok:lombok'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

Expand All @@ -55,54 +40,42 @@ dependencies {
//test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation "org.testcontainers:mariadb:1.19.8"
testImplementation "org.testcontainers:testcontainers:1.19.8"
testImplementation "org.testcontainers:junit-jupiter:1.19.8"
testImplementation "org.testcontainers:localstack:1.19.8"
testImplementation "org.jeasy:easy-random-core:5.0.0"

testImplementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
testImplementation "org.testcontainers:mariadb:${testContainersVersion}"
testImplementation "org.testcontainers:testcontainers:${testContainersVersion}"
testImplementation "org.testcontainers:junit-jupiter:${testContainersVersion}"
testImplementation "org.testcontainers:localstack:${testContainersVersion}"
testImplementation "org.jeasy:easy-random-core:${easyRandomVersion}"


// querydsl
implementation 'com.querydsl:querydsl-jpa'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa"

// s3
implementation 'io.awspring.cloud:spring-cloud-aws-s3:3.0.2'
implementation "io.awspring.cloud:spring-cloud-aws-s3:${s3Version}"


annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

// jwt
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'

asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
implementation "io.jsonwebtoken:jjwt-api:${jjwtVersion}"
runtimeOnly "io.jsonwebtoken:jjwt-impl:${jjwtVersion}"
runtimeOnly "io.jsonwebtoken:jjwt-jackson:${jjwtVersion}"

//email
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation group: 'software.amazon.awssdk', name: 'ses', version: "2.19.29"
implementation 'com.sun.mail:javax.mail:1.6.2'

testImplementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation "software.amazon.awssdk:ses:${sesVersion}"
implementation "com.sun.mail:javax.mail:${javaxMailVersion}"

//Swagger
implementation 'org.springdoc:springdoc-openapi-ui:1.6.11'

//OpenCsv
implementation group: 'com.opencsv', name: 'opencsv', version: '5.7.1'

// Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation "org.springdoc:springdoc-openapi-ui:${swaggerVersion}"

// Prometheus
implementation 'io.micrometer:micrometer-registry-prometheus'
// OpenCsv
implementation "com.opencsv:opencsv:${opencsvVersion}"

// quartz
implementation group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.2'
// Quartz
implementation "org.quartz-scheduler:quartz:${quartzVersion}"
}

tasks.named('bootBuildImage') {
Expand All @@ -127,57 +100,10 @@ clean.doLast {
file(querydslDir).deleteDir()
}

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

test {
outputs.dir snippetsDir
finalizedBy jacocoTestReport
}

asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
dependsOn test
}

bootJar {
dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}

asciidoctor.doFirst { //(6) asciidoctor가 실행될 때 docs 하위 파일 삭제
delete file('src/main/resources/static/docs')
}

bootJar { //(7) bootJar 시 asciidoctor 종속되고 build하위 스니펫츠 파일을 classes 하위로 복사
dependsOn asciidoctor
copy {
from "${asciidoctor.outputDir}"
into 'BOOT-INF/classes/static/docs'
}
}

task copyDocument(type: Copy) { //(8) from의 파일을 into로 복사
dependsOn asciidoctor
from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}

build { //(9) build 시 copyDocument 실행
dependsOn copyDocument
}
tasks.named('compileJava') {
dependsOn 'spotlessApply'
}

jar {
enabled = false
}

spotless {
java {
// Google Java 포맷 적용
Expand Down Expand Up @@ -262,4 +188,4 @@ jacocoTestCoverageVerification {
]
}
}
}
}
40 changes: 0 additions & 40 deletions docker-compose-monitoring.yml

This file was deleted.

27 changes: 27 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
### Application Version ###
applicationVersion=1.0.0

### Project Configs ###
projectGroup=com.gaebaljip
javaVersion=17

### Spring Dependencies ###
springBootVersion=2.7.11
springDependencyManagementVersion=1.1.4

### QueryDSL ###
queryDSLVersion=5.0.0

### TestContainer ###
testContainersVersion=1.19.8

## ?? ##
spotlessVersion=6.23.3
easyRandomVersion=5.0.0
quartzVersion=2.3.2
opencsvVersion=5.7.1
swaggerVersion=1.6.11
javaxMailVersion=1.6.2
sesVersion=2.19.29
jjwtVersion=0.11.5
s3Version=3.0.2

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 2 additions & 8 deletions src/main/java/com/gaebaljip/exceed/common/log/LoggingFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@
public class LoggingFilter extends OncePerRequestFilter {
public static final String SWAGGER_URI = "/swagger-ui";
private static final List<String> excludeUrl =
List.of(
"/actuator/health",
"/actuator/prometheus",
"/v1/health",
"/api-docs/swagger-config",
"/api-docs",
"/favicon.ico");
List.of("/v1/health", "/api-docs/swagger-config", "/api-docs", "/favicon.ico");

@Override
protected void doFilterInternal(
Expand All @@ -53,7 +47,7 @@ protected void doFilterInternal(
httpServletRequest, httpServletResponse, stopWatch.getTotalTimeSeconds());
log.info("{}", httpLogMessage);

httpServletResponse.copyBodyToResponse(); // 다시한번 더 바디를 채워준다.
httpServletResponse.copyBodyToResponse();

MDC.remove(LogKey.KEY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.antMatchers(
HttpMethod.GET,
"/v1/members/email/checked",
"/actuator/**",
"/v1/health",
"/v1//findPassword-redirect",
"/v1/signUp-redirect",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import java.io.IOException;
import java.time.LocalDateTime;
import java.util.List;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
Expand Down Expand Up @@ -36,7 +35,6 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
private final JwtResolver jwtResolver;
private final MemberDetailService memberDetailService;
private final SpringEnvironmentHelper springEnvironmentHelper;
private final List<String> excludeUrl = List.of("/actuator", "/v1/health");

@Override
protected void doFilterInternal(
Expand Down Expand Up @@ -87,18 +85,6 @@ && isSwaggerRequest(request)) {
filterChain.doFilter(request, response);
}

@Override
protected boolean shouldNotFilter(HttpServletRequest request) throws ServletException {
String path = request.getRequestURI();
boolean flag = false;
for (String url : excludeUrl) {
if (path.contains(url)) {
flag = true;
}
}
return flag;
}

private boolean isSwaggerRequest(HttpServletRequest request) {
String servletPath = request.getServletPath();
return PatternMatchUtils.simpleMatch(SwaggerPatterns, servletPath);
Expand Down
13 changes: 0 additions & 13 deletions src/main/java/com/gaebaljip/exceed/config/ActuatorConfig.java

This file was deleted.

Loading