-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
64 lines (56 loc) · 1.92 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
group 'com.github.hesimin'
version '1.0-SNAPSHOT'
def artifactId = "dubbo-hystrix"
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = 1.7
repositories {
mavenLocal()
maven {
url "http://10.0.18.22:8081/nexus/content/groups/public/"
}
mavenCentral()
}
dependencies {
compile 'com.netflix.hystrix:hystrix-core:1.5.12'
compile 'com.netflix.hystrix:hystrix-metrics-event-stream:1.5.12'
compileOnly 'com.alibaba:dubbo:2.5.3'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
// maven pom
install {
repositories.mavenInstaller {
pom.version = "$project.version"
pom.artifactId = "$artifactId"
pom.groupId = "$project.group"
}
}
//上传到nexus
uploadArchives {
repositories {
def File propFile = new File('./mavenAccount.properties')
def Properties props = new Properties()
props.load(new FileInputStream(propFile))
mavenDeployer {
repository(url: "http://10.0.18.22:8081/nexus/content/repositories/releases/") {
def repositoryUserName = props['repositoryUserName']
def repositoryPassword = props['repositoryPassword']
authentication(userName: "admin", password: "admin123")
println '上传release到远程仓库'
}
snapshotRepository(url: 'http://10.0.18.22:8081/nexus/content/repositories/snapshots/') {
def repositoryUserName = props['snapshot-userName']
def repositoryPassword = props['snapshot-password']
authentication(userName: repositoryUserName, password: repositoryPassword)
println '上传snapshot到远程仓库'
}
pom.version = "$project.version"
pom.artifactId = "$artifactId"
pom.groupId = "$project.group"
}
}
}