-
Notifications
You must be signed in to change notification settings - Fork 60
/
build.gradle
201 lines (174 loc) · 6.12 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
group = 'com.webank.webase.node.mgr'
version = '1.0.0-SNAPSHOT'
println "======Gradle version:" + gradle.gradleVersion
if (gradle.gradleVersion.startsWith("7")) {
println "Gradle 7.x not support yet!\n ====== please use Gradle version from 4.6.x to 6.9.x "
} else if (gradle.gradleVersion.startsWith("6")
|| gradle.gradleVersion.startsWith("5")
|| gradle.gradleVersion.startsWith("4.10")
|| gradle.gradleVersion.startsWith("4.9")
|| gradle.gradleVersion.startsWith("4.8")
|| gradle.gradleVersion.startsWith("4.7")
) {
println "Gradle with version >= 4.6 detected"
} else {
println "Gradle with version < 4.6 detected"
}
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
// In this section you declare where to find the dependencies of your project
repositories {
maven {url "http://maven.aliyun.com/nexus/content/groups/public/"}
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url 'https://dl.bintray.com/ethereum/maven/' }
mavenLocal()
}
def springboot_version="2.7.10"
List springboot = [
"org.springframework.boot:spring-boot-starter-web:$springboot_version",
"org.springframework.boot:spring-boot-starter-security:$springboot_version",
"org.springframework.boot:spring-boot-starter-mail:$springboot_version",
"org.springframework.boot:spring-boot-starter-thymeleaf:$springboot_version",
"org.springframework.boot:spring-boot-starter-aop:$springboot_version",
"org.springframework.boot:spring-boot-starter-validation:$springboot_version",
"org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.4"
]
List jaxb = [
"javax.xml.bind:jaxb-api:2.3.0",
"com.sun.xml.bind:jaxb-impl:2.3.0",
"com.sun.xml.bind:jaxb-core:2.3.0",
"javax.activation:activation:1.1.1"
]
List lombok = [
"org.projectlombok:lombok:1.18.12"
]
def jackson_version = "2.14.2"
List jackson = [
"com.fasterxml.jackson.core:jackson-databind:$jackson_version",
"com.fasterxml.jackson.core:jackson-annotations:$jackson_version",
"com.fasterxml.jackson.core:jackson-core:$jackson_version",
"com.fasterxml.jackson.module:jackson-module-parameter-names:$jackson_version",
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jackson_version",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version",
]
List test = [
"org.springframework.boot:spring-boot-starter-test:$springboot_version"
]
def log4j_version="2.18.0"
List log4j = [
"org.apache.logging.log4j:log4j-api:$log4j_version",
"org.apache.logging.log4j:log4j-core:$log4j_version",
"org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version",
"org.apache.logging.log4j:log4j-web:$log4j_version"
]
List mbg = [
'org.mybatis.generator:mybatis-generator-core:1.3.2',
'tk.mybatis:mapper:3.3.2',
'com.github.yuanmomo:mybatis-generator-plugin:1.0.9'
]
List scaffold = [
'com.webank.webase:solscaffold:1.0.2',
'com.webank:SmartDev-Scaffold:1.0.0.1',
'com.webank:solc-gradle-plugin:1.0.1'
]
List swagger = [
'io.springfox:springfox-swagger2:2.8.0',
'io.springfox:springfox-swagger-ui:2.8.0'
]
dependencies {
compile springboot,jaxb,jackson,log4j,scaffold,swagger
compile ('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:2.9.2') {
// 不需要连接节点,因此去除
exclude group: "org.fisco-bcos", module: 'netty-sm-ssl-context'
}
compile "org.apache.commons:commons-lang3:3.8.1"
compile 'org.apache.commons:commons-collections4:4.4'
compile "mysql:mysql-connector-java:8.0.22"
compile "com.zaxxer:HikariCP:3.2.0"
compile "com.github.sgroschupf:zkclient:0.1"
compile 'org.bouncycastle:bcprov-jdk15on:1.67'
// cover old version
compile 'com.google.guava:guava:29.0-jre'
compile 'org.slf4j:jcl-over-slf4j:1.7.30'
compile 'org.yaml:snakeyaml:2.0'
compile 'com.jcraft:jsch:0.1.55'
compile 'org.ini4j:ini4j:0.5.4'
compile ('com.github.docker-java:docker-java:3.2.1') {
exclude group: 'io.netty'
exclude group: 'org.bouncycastle'
exclude group: 'org.apache.commons'
}
compile 'org.thymeleaf:thymeleaf:3.0.11.RELEASE'
// 使用3.1.26才能确保Thymeleaf正常
// compile 'ognl:ognl:3.2.14'
testCompile test,mbg
compileOnly lombok
annotationProcessor lombok
testCompileOnly lombok
testAnnotationProcessor lombok
}
configurations {
all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
all*.exclude group: 'log4j', module: 'log4j'
all*.exclude group: 'org.ow2.asm', module: 'asm'
all*.exclude group: 'jline', module: 'jline'
all*.exclude group: 'com.google.protobuf', module: 'protobuf-java'
all*.exclude group: 'javax.annotation', module: 'javax.annotation-api'
// scaffold imported, not using ssl connect with fisco node, exclude it
all*.exclude group: "org.fisco-bcos", module: 'netty-sm-ssl-context'
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
}
clean {
delete 'dist'
delete 'build'
delete 'log'
}
jar {
destinationDir file('dist/apps')
archiveName project.name + '.jar'
exclude '**/*.xml'
exclude '**/*.yml'
exclude '**/*.properties'
doLast {
copy {
from file('src/main/resources/')
into 'dist/conf_template'
}
copy {
from file('gradle')
into 'dist/gradle'
}
copy {
from file('script/')
into 'dist/script'
}
copy {
from configurations.runtime
into 'dist/lib'
}
copy {
from file('.').listFiles().findAll{File f -> (f.name.endsWith('.sh') || f.name.endsWith('.env'))}
into 'dist'
}
copy {
from file('release_note.txt')
into 'dist'
}
}
}