Skip to content

Commit

Permalink
setting: initialize spring boot project
Browse files Browse the repository at this point in the history
  • Loading branch information
lcomment committed Aug 7, 2023
1 parent b49b7d9 commit c3f02f3
Show file tree
Hide file tree
Showing 9 changed files with 569 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### mac os ###
.DS_Store

### yml ###
*-aws.yml
152 changes: 152 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.2'
id 'io.spring.dependency-management' version '1.1.2'
id 'checkstyle'
id 'jacoco'
}

group = 'com.na-jasin'
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')

// 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']
}
}
}

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'

// ORM
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

// Database
runtimeOnly 'com.h2database:h2'
implementation 'mysql:mysql-connector-java:8.0.28'

// S3
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'

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

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

// 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'
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c3f02f3

Please sign in to comment.