1
- publishing {
2
- publications {
3
- MyPublication (MavenPublication ) {
4
- from components. java
5
- artifact javadocJar
6
- artifact sourcesJar
7
-
8
- groupId ' com.nhaarman'
9
- artifactId ' mockito-kotlin'
10
- version rootProject. ext. versionName
11
- }
12
- }
13
- }
1
+ apply plugin : ' maven'
2
+ apply plugin : ' signing'
14
3
15
- bintray {
16
- user = hasProperty( ' bintray_user ' ) ? bintray_user : System . getenv( ' BINTRAY_USER ' )
17
- key = hasProperty(' bintray_key ' ) ? bintray_key : System . getenv(' BINTRAY_KEY ' )
18
- publications = [ ' MyPublication ' ]
4
+ group = ' com.nhaarman '
5
+ version = rootProject . ext . versionName
6
+ def sonatypeUsername = hasProperty(' sonatype_username ' ) ? sonatype_username : System . getenv(' SONATYPE_USERNAME ' )
7
+ def sonatypePassword = hasProperty( ' sonatype_password ' ) ? sonatype_password : System . getenv( ' SONATYPE_PASSWORD ' )
19
8
20
- pkg {
21
- repo = ' maven'
22
- name = " Mockito-Kotlin"
23
- desc = " Using Mockito with Kotlin"
24
-
25
- licenses = [' MIT' ]
26
- vcsUrl = ' https://github.com/bintray/gradle-bintray-plugin.git'
27
-
28
- version {
29
- name = rootProject. ext. versionName
30
- desc = ' Using Mockito with Kotlin'
31
- vcsTag = rootProject. ext. versionName
32
- }
33
- }
34
- }
35
9
36
10
task javadocJar (type : Jar , dependsOn : javadoc) {
37
11
classifier = ' javadoc'
@@ -41,4 +15,57 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
41
15
task sourcesJar (type : Jar ) {
42
16
from sourceSets. main. allSource
43
17
classifier = ' sources'
18
+ }
19
+
20
+ artifacts {
21
+ archives jar
22
+
23
+ archives javadocJar
24
+ archives sourcesJar
25
+ }
26
+
27
+ signing {
28
+ sign configurations. archives
29
+ }
30
+
31
+ uploadArchives {
32
+ repositories {
33
+ mavenDeployer {
34
+ beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
35
+
36
+ repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2" ) {
37
+ authentication(
38
+ userName : sonatypeUsername,
39
+ password : sonatypePassword
40
+ )
41
+ }
42
+
43
+ pom. project {
44
+ name ' Mockito-Kotlin'
45
+ packaging ' jar'
46
+ description ' Using Mockito with Kotlin.'
47
+ url ' https://github.com/nhaarman/mockito-kotlin'
48
+
49
+ scm {
50
+ url ' scm:git@github.com:nhaarman/mockito-kotlin.git'
51
+ connection ' scm:git@github.com:nhaarman/mockito-kotlin.git'
52
+ developerConnection ' scm:git@github.com:nhaarman/mockito-kotlin.git'
53
+ }
54
+
55
+ licenses {
56
+ license {
57
+ name ' MIT'
58
+ distribution ' repo'
59
+ }
60
+ }
61
+
62
+ developers {
63
+ developer {
64
+ id ' nhaarman'
65
+ name ' Niek Haarman'
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
44
71
}
0 commit comments