Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit f519437

Browse files
committed
#136: Adding config for publishing to OSSRH
1 parent 67c391d commit f519437

File tree

2 files changed

+57
-10
lines changed

2 files changed

+57
-10
lines changed

build.gradle

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
plugins {
2-
id "java-library"
3-
id "maven-publish"
4-
id "eclipse"
5-
id "idea"
2+
id "java-library"
3+
id "maven-publish"
4+
id "maven"
5+
id "signing"
66
id "com.github.jk1.dependency-license-report" version "1.3"
77
id "io.snyk.gradle.plugin.snykplugin" version "0.4"
88
}
99

1010
group = "com.marklogic"
11-
archivesBaseName = "ml-javaclient-util"
1211
version = "4.1-SNAPSHOT"
1312

1413
sourceCompatibility = "8"
@@ -64,16 +63,56 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
6463
}
6564
javadoc.failOnError = false
6665

66+
artifacts {
67+
archives javadocJar, sourcesJar
68+
}
69+
signing {
70+
sign configurations.archives
71+
}
72+
73+
uploadArchives {
74+
repositories {
75+
mavenDeployer {
76+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
77+
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
78+
authentication(userName: ossrhUsername, password: ossrhPassword)
79+
}
80+
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
81+
authentication(userName: ossrhUsername, password: ossrhPassword)
82+
}
83+
pom.project {
84+
name '${group}:${project.name}'
85+
packaging 'jar'
86+
description 'Library that adds functionality on top of the MarkLogic Java Client'
87+
url 'https://github.com/marklogic-community/${project.name}'
88+
scm {
89+
url '[email protected]:marklogic-community/${project.name}.git'
90+
connection 'scm:[email protected]:marklogic-community/${project.name}.git'
91+
developerConnection 'scm:[email protected]:marklogic-community/${project.name}.git'
92+
}
93+
licenses {
94+
license {
95+
name 'The Apache License, Version 2.0'
96+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
97+
}
98+
}
99+
developers {
100+
developer {
101+
id 'marklogic'
102+
name 'MarkLogic Github Contributors'
103+
104+
}
105+
}
106+
}
107+
}
108+
}
109+
}
110+
67111
publishing {
68112
publications {
69113
mainJava(MavenPublication) {
70114
from components.java
71-
}
72-
sourcesJava(MavenPublication) {
73-
from components.java
74115
artifact sourcesJar
75-
}
76-
mavenJavadoc(MavenPublication) {
77116
artifact javadocJar
78117
}
79118
}

gradle.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
# Define this on the command line when running snyk-test
22
snykToken=
3+
4+
# Define these on the command line to publish to OSSRH
5+
# See https://central.sonatype.org/publish/publish-gradle/#credentials for more information
6+
ossrhUsername=
7+
ossrhPassword=
8+
#signing.keyId=YourKeyId
9+
#signing.password=YourPublicKeyPassword
10+
#signing.secretKeyRingFile=PathToYourKeyRingFile

0 commit comments

Comments
 (0)