Skip to content

Commit 121aa41

Browse files
Apply Maven publish plugin and Release 7.1.0
1 parent bbfe070 commit 121aa41

File tree

1 file changed

+67
-64
lines changed

1 file changed

+67
-64
lines changed

build.gradle

+67-64
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
apply plugin: 'java'
22
apply plugin: 'idea'
3-
apply plugin: 'maven'
3+
apply plugin: 'maven-publish'
44
apply plugin: 'eclipse'
55
apply plugin: 'jacoco'
66
apply plugin: 'checkstyle'
77
apply plugin: 'signing'
88

99
import org.apache.tools.ant.filters.*
1010

11-
group 'io.appium'
12-
version '7.0.0'
13-
1411
repositories {
1512
jcenter()
1613
mavenCentral()
@@ -115,83 +112,89 @@ checkstyle {
115112
}
116113
checkstyleMain.excludes = ['**/org/openqa/selenium/**']
117114

118-
task javadocJar(type: Jar) {
119-
classifier = 'javadoc'
120-
from javadoc
121-
}
122-
123115
task sourcesJar(type: Jar) {
124-
classifier = 'sources'
125-
from sourceSets.main.allSource
126-
}
127-
128-
artifacts {
129-
archives javadocJar, sourcesJar
116+
from sourceSets.main.allJava
117+
archiveClassifier = 'sources'
130118
}
131119

132-
signing {
133-
sign configurations.archives
134-
}
135-
136-
uploadArchives {
137-
repositories {
138-
mavenDeployer {
139-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
140-
141-
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
142-
authentication(userName: ossrhUsername, password: ossrhPassword)
143-
}
144-
145-
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
146-
authentication(userName: ossrhUsername, password: ossrhPassword)
147-
}
148-
149-
pom.project {
150-
packaging 'jar'
151-
name 'java-client'
152-
description 'Java client for Appium Mobile Webdriver'
153-
url 'http://appium.io'
120+
task javadocJar(type: Jar) {
121+
from javadoc
122+
archiveClassifier = 'javadoc'
123+
}
124+
125+
javadoc {
126+
options.addStringOption('encoding', 'UTF-8')
127+
}
128+
129+
publishing {
130+
publications {
131+
mavenJava(MavenPublication) {
132+
groupId = 'io.appium'
133+
artifactId = 'java-client'
134+
version = '7.1.0'
135+
from components.java
136+
artifact sourcesJar
137+
artifact javadocJar
138+
pom {
139+
name = 'java-client'
140+
description = 'Java client for Appium Mobile Webdriver'
141+
url = 'http://appium.io'
154142
developers {
155143
developer {
156-
name 'Jonah Stiennon'
157-
158-
url 'https://github.com/jonahss'
159-
id 'jonahss'
160-
};
144+
name = 'Jonah Stiennon'
145+
146+
url = 'https://github.com/jonahss'
147+
id = 'jonahss'
148+
}
161149
developer {
162-
name 'Sergey Tikhomirov'
163-
164-
url 'https://github.com/TikhomirovSergey'
165-
id 'TikhomirovSergey'
166-
};
150+
name = 'Sergey Tikhomirov'
151+
152+
url = 'https://github.com/TikhomirovSergey'
153+
id = 'TikhomirovSergey'
154+
}
167155
developer {
168-
name 'Srinivasan Sekar'
169-
170-
url 'https://github.com/SrinivasanTarget'
171-
id 'SrinivasanTarget'
172-
};
156+
name = 'Srinivasan Sekar'
157+
158+
url = 'https://github.com/SrinivasanTarget'
159+
id = 'SrinivasanTarget'
160+
}
173161
developer {
174-
name 'Mykola Mokhnach'
175-
url 'https://github.com/mykola-mokhnach'
176-
id 'mykola-mokhnach'
177-
};
162+
name = 'Mykola Mokhnach'
163+
url = 'https://github.com/mykola-mokhnach'
164+
id = 'mykola-mokhnach'
165+
}
178166
}
179167
licenses {
180168
license {
181-
name 'Apache License, Version 2.0'
182-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
183-
distribution 'repo'
169+
name = 'Apache License, Version 2.0'
170+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
171+
distribution = 'repo'
184172
}
185173
}
186174
scm {
187-
url 'https://github.com/appium/java-client'
188-
connection 'scm:git:ssh://[email protected]/appium/java-client.git'
189-
developerConnection 'scm:git:ssh://[email protected]/appium/java-client.git'
190-
tag 'HEAD'
175+
url = 'https://github.com/appium/java-client'
176+
connection = 'scm:git:ssh://[email protected]/appium/java-client.git'
177+
developerConnection = 'scm:git:ssh://[email protected]/appium/java-client.git'
178+
tag = 'HEAD'
191179
}
192180
}
193181
}
194182
}
183+
repositories {
184+
maven {
185+
credentials {
186+
username "$ossrhUsername"
187+
password "$ossrhPassword"
188+
}
189+
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
190+
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/'"
191+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
192+
}
193+
}
194+
}
195+
196+
signing {
197+
sign publishing.publications.mavenJava
195198
}
196199

197200
wrapper {
@@ -233,4 +236,4 @@ task uiAutomationTest( type: Test ) {
233236
includeTestsMatching 'io.appium.java_client.android.ClipboardTest'
234237
includeTestsMatching '*.AndroidAppStringsTest'
235238
}
236-
}
239+
}

0 commit comments

Comments
 (0)