forked from e-commerce-sample/ecommerce-order-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
140 lines (115 loc) · 4.95 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
buildscript {
repositories {
maven { url "https://maven.aliyun.com/repository/central" }
}
dependencies {
classpath "com.avast.gradle:gradle-docker-compose-plugin:0.9.1"
classpath "org.owasp:dependency-check-gradle:5.0.0-M2"
classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.7.1"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7"
}
}
plugins {
id 'application'
id "org.springframework.boot" version "2.1.4.RELEASE"
id "io.spring.dependency-management" version "1.0.6.RELEASE"
}
repositories {
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "http://localhost:9091/repository/maven-snapshots/" }
}
application {
mainClassName = "com.ecommerce.Application"
applicationDefaultJvmArgs = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"]
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
//spring dependencies
implementation('org.springframework.boot:spring-boot-starter-web')
implementation('org.springframework.boot:spring-boot-starter-actuator')
implementation("org.springframework.boot:spring-boot-starter-aop")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("com.ecommerce:common:0.1-SNAPSHOT")
//common dependencies
implementation("mysql:mysql-connector-java:8.0.15")
implementation('io.jsonwebtoken:jjwt:0.9.1')
implementation("org.flywaydb:flyway-core")
implementation('com.google.guava:guava:27.0.1-jre')
implementation('commons-io:commons-io:2.6')
implementation('org.apache.commons:commons-lang3')
implementation('org.apache.commons:commons-collections4:4.2')
implementation('io.springfox:springfox-swagger2:2.9.2')
implementation('io.springfox:springfox-swagger-ui:2.9.2')
implementation('com.cwbase:logback-redis-appender:1.1.5')
implementation('net.javacrumbs.shedlock:shedlock-spring:2.4.0')
implementation('net.javacrumbs.shedlock:shedlock-provider-jdbc-template:2.4.0')
//jackson dependencies
implementation('com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8')
implementation('com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8')
implementation('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8')
implementation('com.fasterxml.jackson.core:jackson-core:2.9.8')
implementation('com.fasterxml.jackson.core:jackson-databind:2.9.8')
implementation('com.fasterxml.jackson.core:jackson-annotations:2.9.8')
implementation("org.springframework.boot:spring-boot-starter-amqp")
//test dependencies
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.rest-assured:spring-mock-mvc")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation('org.junit.jupiter:junit-jupiter-engine')
testImplementation('org.mockito:mockito-junit-jupiter:2.26.0')
}
sourceSets {
componentTest {
compileClasspath += sourceSets.main.output + sourceSets.test.output
runtimeClasspath += sourceSets.main.output + sourceSets.test.output
}
apiTest {
compileClasspath += sourceSets.main.output + sourceSets.test.output
runtimeClasspath += sourceSets.main.output + sourceSets.test.output
}
}
configurations {
componentTestImplementation.extendsFrom testImplementation
componentTestRuntimeOnly.extendsFrom testRuntimeOnly
apiTestImplementation.extendsFrom testImplementation
apiTestRuntimeOnly.extendsFrom testRuntimeOnly
}
task componentTest(type: Test) {
description = 'Run component tests.'
group = 'verification'
testClassesDirs = sourceSets.componentTest.output.classesDirs
classpath = sourceSets.componentTest.runtimeClasspath
shouldRunAfter test
}
task apiTest(type: Test) {
description = 'Run API tests.'
group = 'verification'
testClassesDirs = sourceSets.apiTest.output.classesDirs
classpath = sourceSets.apiTest.runtimeClasspath
shouldRunAfter componentTest
}
configurations.all {
exclude group: "junit", module: "junit"
exclude group: "org.assertj", module: "assertj-core"
}
tasks.withType(Test) {
useJUnitPlatform()
}
check.dependsOn componentTest
check.dependsOn apiTest
bootJar {
launchScript()
}
wrapper {
gradleVersion = '5.2.1'
}
apply from: "${rootProject.projectDir}/gradle/idea.gradle"
apply from: "${rootProject.projectDir}/gradle/docker-compose/docker-compose.gradle"
apply from: "${rootProject.projectDir}/gradle/dependency-check/dependency-check.gradle"
apply from: "${rootProject.projectDir}/gradle/spotbugs/spotbugs.gradle"
apply from: "${rootProject.projectDir}/gradle/checkstyle/checkstyle.gradle"
apply from: "${rootProject.projectDir}/gradle/git-hooks/git-hooks.gradle"
apply from: "${rootProject.projectDir}/gradle/version-info.gradle"
apply from: "${rootProject.projectDir}/gradle/jacoco.gradle"
//apply from: "${rootProject.projectDir}/gradle/sonarqube.gradle"