Skip to content

Commit

Permalink
Merge pull request #194 from themoment-team/develop
Browse files Browse the repository at this point in the history
Gradle 마이그레이션, Table -> Uncomfortable 마이그레이션
  • Loading branch information
siwony authored Sep 7, 2021
2 parents 6a3394f + 062819f commit 29137d1
Show file tree
Hide file tree
Showing 35 changed files with 899 additions and 1,225 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ target/
!**/src/main/**/target/
!**/src/test/**/target/

out

### STS ###
.apt_generated
.classpath
Expand Down Expand Up @@ -35,5 +37,14 @@ build/
### log ###
/logs/**

### Gradle ###
.gradle

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

### Gradle Patch ###
**/build/

### apllication config ###
#/src/main/resources/application.yml
117 changes: 0 additions & 117 deletions .mvn/wrapper/MavenWrapperDownloader.java

This file was deleted.

Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VOLUME /tmp
EXPOSE 8080

# The application's jar file
ARG JAR_FILE=target/the-0.0.1-SNAPSHOT.jar
ARG JAR_FILE=build/libs/the-0.0.1-SNAPSHOT.jar

# Add the application's jar to the container
ADD ${JAR_FILE} the_moment_server.jar
Expand Down
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,18 @@
<br>

#### GET start
```
- install maven
$ sudo apt-get install maven
- checking maven version
$ maven -version
- docker install
#### GET start - ubuntu
```shell
# docker install
$ sudo apt-get install docker.io

- docker-compose install
# docker-compose install
$ sudo apt-get install docker-compose

- start the_moment-server use shell! (Docker Run)
# start the_moment-server use shell! (Docker Run)
$ sudo ./docker-compose-env.sh

- Run in the background as well (prefer)
# Run in the background as well (prefer)
$ sudo nohup ./docker-compose-env.sh &
```

Expand All @@ -37,6 +31,13 @@ $ sudo nohup ./docker-compose-env.sh &
- Validation
- Spring Security
- Spring Data Reactive Redis
- Querydsl
* plugin
- Spring Boot - 2.4.2
- Dependency Management - 1.0.11.RELEASE
- Querydsl - 1.0.10
- Jacoco
* dev tools
- IntelliJ IDEA
Expand All @@ -45,9 +46,9 @@ $ sudo nohup ./docker-compose-env.sh &
- Swagger2
* Deployment
- AWS EC2
- AWS Route 53
- AWS RDS (Mysql)
- AWS EC2
- AWS Route 53
- AWS RDS (Mysql)
```

#### Our Server License
Expand Down
156 changes: 156 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
id 'java'
id 'org.springframework.boot' version '2.4.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id "com.ewerk.gradle.plugins.querydsl" version '1.0.10'
id 'jacoco'
}

repositories {
mavenCentral()
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}

group = 'com.moment'
version = '0.0.1-SNAPSHOT'
description = 'the'
java.sourceCompatibility = JavaVersion.VERSION_11

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// Swagger
implementation 'io.springfox:springfox-swagger-ui:2.9.1'
implementation 'io.springfox:springfox-swagger2:2.9.1'
implementation 'io.swagger:swagger-annotations:1.6.2'
implementation 'io.swagger:swagger-models:1.6.2'

// JWT토큰 관련 의존성
implementation 'io.jsonwebtoken:jjwt-api:0.11.1'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.1'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.1'

// modelMapper
implementation 'org.modelmapper:modelmapper:2.3.0'

implementation 'net.rakugakibox.util:yaml-resource-bundle:1.1'

implementation 'io.fabric8:docker-maven-plugin:0.30.0'

// lombok
implementation 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

// DB
runtimeOnly 'com.h2database:h2'
runtimeOnly 'mysql:mysql-connector-java'

// QueryDSL
compileOnly 'com.querydsl:querydsl-jpa'
compileOnly 'com.querydsl:querydsl-apt'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.junit.jupiter:junit-jupiter-params'

compileOnly 'org.springframework.boot:spring-boot-starter-tomcat'
}

test {
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
}
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}

jacoco {
toolVersion = '0.8.7'
}

jacocoTestReport {
reports {
html.enabled true
csv.enabled false
xml.enabled false
}
afterEvaluate {
classDirectories.from = files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/exception/**'
,'**/dto/**'
,'**/repository/**' // DAO(repository)
,'**/embeddedTypes/**' //embeddedTypes 제거
,'**/the/TheApplication*'
,'**/the/**/*Test*'
,'**/the/**/Q*' // Q class 제거
])
})
}
finalizedBy 'jacocoTestCoverageVerification'
}

jacocoTestCoverageVerification {
violationRules {
rule {
// 룰을 키고 끌 수 있다.
enabled = false

// 룰을 체크할 단위
element = 'BUNDLE'

// Java 바이트코드 를 통한 코드실행
limit {
counter = 'INSTRUCTION'
value = 'COVEREDRATIO'
minimum = 0.50
}
}
}
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

def querydslDir = "$buildDir/generated/querydsl"

querydsl {
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets {
main.java.srcDir querydslDir
}
configurations {
querydsl.extendsFrom compileClasspath
}
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}
13 changes: 2 additions & 11 deletions docker-compose-env.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#!/bin/bash
echo "====mvn clean======"
./mvnw clean

echo "=====mvn compile====="
./mvnw compile

echo "======mvn package======"
./mvnw package

echo "======docker-compose build======"
docker-compose build
echo "====gradle clean build======"
./gradlew clean build

echo "======docker-compose up======="
docker-compose up
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 29137d1

Please sign in to comment.