@@ -36,12 +36,12 @@ apply plugin: 'java'
3636apply plugin : ' com.google.protobuf'
3737apply plugin : ' idea'
3838apply plugin : ' com.github.sherter.google-java-format'
39- apply plugin : ' maven-publish '
39+ apply plugin : ' maven'
4040apply plugin : ' signing'
4141
4242group = ' io.dgraph'
4343archivesBaseName = ' dgraph4j'
44- version = ' 2.1 .0'
44+ version = ' 20.03 .0'
4545sourceCompatibility = 1.8
4646targetCompatibility = 1.8
4747
@@ -196,83 +196,37 @@ if(project.hasProperty("ossrhUsername")) {
196196 sign configurations. archives
197197 }
198198
199- publishing {
200- publications {
201- mavenJava(MavenPublication ) {
202- customizePom(pom)
203- groupId ' io.dgraph'
204- artifactId ' dgraph4j'
205- version " ${ dgraph4jVersion} "
206-
207- from components. java
208-
209- pom. withXml {
210- def pomFile = file(" ${ project.buildDir} /generated-pom.xml" )
211- writeTo(pomFile)
212- def pomAscFile = signing. sign(pomFile). signatureFiles[0 ]
213- artifact(pomAscFile) {
214- classifier = null
215- extension = ' pom.asc'
216- }
217- }
199+ uploadArchives {
200+ repositories {
201+ mavenDeployer {
202+ beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
218203
219- artifact(sourceJar ) {
220- classifier = ' sources '
204+ repository( url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/ " ) {
205+ authentication( userName : ossrhUsername, password : ossrhPassword)
221206 }
222207
223- artifact(javadocJar ) {
224- classifier = ' javadoc '
208+ snapshotRepository( url : " https://oss.sonatype.org/content/repositories/snapshots/ " ) {
209+ authentication( userName : ossrhUsername, password : ossrhPassword)
225210 }
226211
227- // create the signed artifacts
228- project. tasks. signArchives. signatureFiles. each {
229- artifact(it) {
230- def matcher = it. file =~ / -(sources|javadoc)\. jar\. asc$/
231- if (matcher. find()) {
232- classifier = matcher. group(1 )
233- } else {
234- classifier = null
235- }
236- extension = ' jar.asc'
237- }
238- }
239- }
240- }
241- repositories {
242- maven {
243- url " https://oss.sonatype.org/service/local/staging/deploy/maven2"
244- credentials {
245- username ossrhUsername
246- password ossrhPassword
247- }
248- }
249- }
250- }
251- }
252-
253- def customizePom (pom ) {
254- pom. withXml {
255- def root = asNode()
256-
257- // add all items necessary for maven central publication
258- root. children(). last() + {
259- resolveStrategy = Closure . DELEGATE_FIRST
260-
261- description ' Dgraph Java Client'
262- name ' dgraph4'
263- url ' https://github.com/dgraph-io/dgraph4'
264- licenses {
265- license {
266- name ' Apache License 2.0'
267- url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
268- distribution ' repo'
269- }
270- }
212+ pom. project {
213+ name ' dgraph4j'
214+ packaging ' jar'
215+ artifactId ' dgraph4j'
216+ description ' Dgraph Java Client'
217+ url ' https://github.com/dgraph-io/dgraph4j'
271218
272219 scm {
273220 connection ' https://github.com/dgraph-io/dgraph4j.git'
274- url ' https://github.com/dgraph-io/dgraph4j'
221+ url ' https://github.com/dgraph-io/dgraph4j'
222+ }
275223
224+ licenses {
225+ license {
226+ name ' Apache License 2.0'
227+ url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
228+ distribution ' repo'
229+ }
276230 }
277231
278232 developers {
@@ -281,20 +235,12 @@ def customizePom(pom) {
281235 }
282236 }
283237 }
284- }
285- model {
286- tasks. generatePomFileForMavenJavaPublication {
287- destination = file(" $buildDir /generated-pom.xml" )
288- }
289- tasks. publishMavenJavaPublicationToMavenLocal {
290- dependsOn project. tasks. signArchives
291- }
292- tasks. publishMavenJavaPublicationToMavenRepository {
293- dependsOn project. tasks. signArchives
294238 }
295239 }
240+ }
296241}
297242
243+
298244task version () {
299245 doLast {
300246 println dgraph4jVersion
0 commit comments