-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.gradle
99 lines (81 loc) · 2.56 KB
/
deploy.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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
group = 'com.github.romansl'
archivesBaseName = 'purl'
version = '1.0'
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.+'
}
compileJava {
options.encoding = "UTF-8"
}
sourceSets {
main.java.srcDirs = ['src']
sourceSets.test.java.srcDirs = ['test']
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
//repository(url: "file://localhost/tmp/myRepo/")
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: nexusUsername, password: nexusPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: nexusUsername, password: nexusPassword)
}
pom {
project {
name 'Pure URL Builder'
description 'URL builder based on pure functional principles. No side effects. ' +
'Immutable. Thread-safe. Easy to use.'
url 'https://github.com/romansl/PureURLBuilder'
packaging 'jar'
developers {
developer {
id 'romansl'
name 'Roman Leukin'
email 'leukinrs@gmail.com'
}
}
scm {
url 'https://github.com/romansl/PureURLBuilder'
connection 'scm:git:git@github.com:romansl/PureURLBuilder.git'
developerConnection 'scm:git:git@github.com:romansl/PureURLBuilder.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}
}
}
install {
configuration = configurations.archives
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task docsJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourceJar
archives docsJar
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}