forked from Meituan-Dianping/Robust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgradle_mvn_push.gradle
34 lines (33 loc) · 980 Bytes
/
gradle_mvn_push.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
group = GROUP
version = VERSION_NAME
apply plugin: 'maven-publish'
publishing {
publications {
maven(MavenPublication) {
groupId = GROUP
artifactId = project.name
version = VERSION_NAME
try {
from components.java
} catch (Exception e) {
afterEvaluate {
from components.release
}
}
}
}
repositories {
Properties properties = new Properties()
def propertiesFile = project.rootProject.file('local.properties')
if (propertiesFile.exists()) {
properties.load(propertiesFile.newDataInputStream())
def publishLocal = properties.getProperty('publish.local')
println "publishLocal:" + publishLocal
maven {
url = publishLocal
}
}else {
mavenLocal()
}
}
}