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'
143
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 ' )
198
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- }
359
3610task javadocJar (type : Jar , dependsOn : javadoc) {
3711 classifier = ' javadoc'
38- from ' build/docs/ javadoc'
12+ from ' build/javadoc'
3913}
4014
4115task sourcesJar (type : Jar ) {
4216 from sourceSets. main. allSource
4317 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:[email protected] :nhaarman/mockito-kotlin.git' 51+ connection
' scm:[email protected] :nhaarman/mockito-kotlin.git' 52+ developerConnection
' scm:[email protected] :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+ }
4471}
0 commit comments