-
Notifications
You must be signed in to change notification settings - Fork 17
/
upload.gradle
executable file
·31 lines (26 loc) · 1.09 KB
/
upload.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
apply plugin: 'maven'
//def sonatypeRepositoryUrl = "http://maven.wallstcn.com/nexus/content/repositories/thirdparty/"
def sonatypeRepositoryUrl = "file://" + rootDir.absolutePath + "/.repo"
Properties config = new Properties()
config.load(project.file("nexus.properties").newDataInputStream())
def nexus_versionName = config.getProperty('nexus_versionName')
def nexus_artifactId = config.getProperty('nexus_artifactId')
def nexus_groupId = config.getProperty('nexus_groupId')
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.groupId = nexus_groupId
pom.artifactId = nexus_artifactId
pom.version = nexus_versionName + '-SNAPSHOT'
repository(url: sonatypeRepositoryUrl) {
try {
authentication(userName: properties.getProperty("userName"), password: properties.getProperty("password"))
} catch (Exception e) {
println(e.getMessage())
}
}
}
}
}
}