-
Notifications
You must be signed in to change notification settings - Fork 326
/
Copy pathbuild.gradle
37 lines (35 loc) · 1.36 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
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.4.RELEASE")
//引入gradle-docker
classpath('gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.19.2')
}
}
//引入构建docker插件
apply plugin: 'com.palantir.docker'
apply plugin: 'org.springframework.boot'
apply plugin: 'application'
group = 'redis-docker'
version = project.findProperty('projVersion') ?: '1.0.0'
mainClassName = 'com.dashuai.learning.redissentinel.RedisSentinelApplication'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.0.4.RELEASE'
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
compile group: 'org.springframework.data', name: 'spring-data-redis', version: '2.0.4.RELEASE'
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.0.4.RELEASE'
}
//具体配置生成镜像
docker {
dockerfile file('Dockerfile')
name "${project.group}/springboot-redis-sentinel:${project.version}"
files jar.archivePath
buildArgs(['JAR_FILE': "${jar.archiveName}"])
}