-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
> ### Feature: #3 CICD 구축을 위한 프로젝트 merge (#7) * feature: setting issue template * feature: setting pr template * feature: setting .gitignore * Feature: #2 프로젝트 초기 세팅 (#6) * 🎉Initialize cafree server project * setting: naver code convention 추가 * chore: 의존성 추가 및 Jacoco, codestyle(naver) 적용 * feature: Jpa, s3, Security 설정 * feature: s3 업로드 관련 uploader, dto 구현
- Loading branch information
Showing
21 changed files
with
1,315 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.1.1' | ||
id 'io.spring.dependency-management' version '1.1.0' | ||
id 'org.asciidoctor.jvm.convert' version '3.3.2' | ||
id 'checkstyle' | ||
id 'jacoco' | ||
} | ||
|
||
group = 'net.cafree' | ||
version = '1.0.0-SNAPSHOT' | ||
|
||
java { | ||
sourceCompatibility = '17' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
finalizedBy jacocoTestReport | ||
|
||
jacoco { | ||
enabled = true | ||
destinationFile = file("${buildDir}/jacoco/${name}.exec") | ||
includes = [] | ||
excludes = [] | ||
excludeClassLoaders = [] | ||
includeNoLocationClasses = false | ||
sessionId = "<auto-generated value>" | ||
dumpOnExit = true | ||
classDumpDir = null | ||
output = JacocoTaskExtension.Output.FILE | ||
address = "localhost" | ||
port = 6300 | ||
jmx = false | ||
} | ||
} | ||
|
||
configurations { | ||
asciidoctorExtensions | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
compileJava.options.encoding = 'UTF-8' | ||
compileTestJava.options.encoding = 'UTF-8' | ||
|
||
|
||
// checkstyle | ||
tasks.withType(Checkstyle).configureEach { | ||
reports { | ||
xml.required = true | ||
html.required = true | ||
} | ||
} | ||
|
||
checkstyle { | ||
configFile = file("config/checkstyle/naver-checkstyle-rules.xml") | ||
configProperties = ["suppressionFile": "config/checkstyle/naver-checkstyle-suppressions.xml"] | ||
sourceSets = [sourceSets.main] | ||
} | ||
|
||
checkstyleMain.source = fileTree('src/main/java') | ||
|
||
// Rest Docs | ||
ext { | ||
set('snippetsDir', file("build/generated-snippets")) | ||
} | ||
|
||
asciidoctor { | ||
dependsOn test | ||
inputs.dir snippetsDir | ||
configurations 'asciidoctorExtensions' | ||
} | ||
|
||
asciidoctor.doFirst { | ||
delete file('src/main/resources/static/docs') | ||
} | ||
|
||
bootJar { | ||
dependsOn asciidoctor | ||
from("${asciidoctor.outputDir}/html5") { | ||
into 'BOOT-INF/classes/static/docs' | ||
} | ||
} | ||
|
||
tasks.register('copyDocument', Copy) { | ||
dependsOn asciidoctor | ||
|
||
from file("build/docs/asciidoc") | ||
into file("src/main/resources/static/docs") | ||
} | ||
|
||
build { | ||
dependsOn copyDocument | ||
} | ||
|
||
tasks.named('test') { | ||
outputs.dir snippetsDir | ||
} | ||
|
||
// jacoco | ||
jacoco { | ||
toolVersion = "0.8.10" | ||
} | ||
|
||
jacocoTestReport { | ||
dependsOn test | ||
reports { | ||
html.required = true | ||
xml.required = false | ||
csv.required = false | ||
|
||
html.outputLocation = file("$buildDir/jacocoHtml") | ||
} | ||
finalizedBy 'jacocoTestCoverageVerification' | ||
} | ||
|
||
jacocoTestCoverageVerification { | ||
violationRules { | ||
rule { | ||
enabled = true | ||
element = "CLASS" | ||
|
||
limit { | ||
counter = "BRANCH" | ||
value = "COVEREDRATIO" | ||
minimum = 0.80 | ||
} | ||
|
||
limit { | ||
counter = "LINE" | ||
value = "COVEREDRATIO" | ||
minimum = 0.80 | ||
} | ||
|
||
limit { | ||
counter = "METHOD" | ||
value = 'COVEREDRATIO' | ||
minimum = 0.80 | ||
} | ||
|
||
excludes = ['*.Application', | ||
'net.cafree.global.**' | ||
] | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
// Basic | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
developmentOnly 'org.springframework.boot:spring-boot-devtools' | ||
|
||
// Security | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' | ||
|
||
// 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 | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
runtimeOnly 'com.h2database:h2' | ||
implementation 'org.mariadb.jdbc:mariadb-java-client:3.1.2' | ||
|
||
// S3 | ||
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' | ||
|
||
// Lombok | ||
compileOnly 'org.projectlombok:lombok' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
|
||
// Test | ||
implementation 'junit:junit:4.13.1' | ||
testImplementation 'junit:junit:4.13.2' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
testImplementation 'io.findify:s3mock_2.13:0.2.6' | ||
} |
Oops, something went wrong.