Skip to content

Commit a73ac92

Browse files
committed
Support Maven Central deployment.
1 parent 0e23e8f commit a73ac92

File tree

2 files changed

+92
-14
lines changed

2 files changed

+92
-14
lines changed

db-client-java/build.gradle

+91-13
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ plugins {
1010
id 'java-library'
1111
id 'com.google.protobuf' version '0.8.12'
1212
id 'idea'
13+
id 'maven'
1314
id 'maven-publish'
15+
id 'signing'
1416
}
1517

18+
group = 'com.eventstore'
19+
version = '0.1'
20+
//archivesBaseName = 'eventstoredb-client-java'
21+
1622
dependencies {
1723
implementation "javax.annotation:javax.annotation-api:${annotationApiVersion}"
1824
implementation "javax.validation:validation-api:${validationApiVersion}"
@@ -56,23 +62,95 @@ protobuf {
5662
}
5763
}
5864

59-
publishing {
65+
task javadocJar(type: Jar) {
66+
archiveClassifier = 'javadoc'
67+
from javadoc
68+
}
69+
70+
task sourcesJar(type: Jar) {
71+
archiveClassifier = 'sources'
72+
from sourceSets.main.allSource
73+
}
74+
75+
artifacts {
76+
archives javadocJar, sourcesJar
77+
}
78+
79+
signing {
80+
useGpgCmd()
81+
sign configurations.archives
82+
}
83+
84+
uploadArchives {
6085
repositories {
61-
maven {
62-
name = "GitHubPackages"
63-
url = uri("https://maven.pkg.github.com/EventStore/EventStoreDB-Client-Java")
64-
credentials {
65-
username = System.getenv("GITHUB_ACTOR")
66-
password = System.getenv("GITHUB_TOKEN")
86+
mavenDeployer {
87+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
88+
89+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
90+
authentication(userName: ossrhUsername, password: ossrhPassword)
91+
}
92+
93+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
94+
authentication(userName: ossrhUsername, password: ossrhPassword)
95+
}
96+
97+
pom.project {
98+
name 'EventStoreDB Client Java'
99+
packaging 'jar'
100+
// optionally artifactId can be defined here
101+
description 'EventStoreDB gRPC Java client'
102+
url 'https://eventstore.com'
103+
104+
scm {
105+
connection 'https://github.com/EventStore/EventStoreDB-Client-Java.git'
106+
developerConnection 'https://github.com/EventStore/EventStoreDB-Client-Java.git'
107+
url 'https://github.com/EventStore/EventStoreDB-Client-Java'
108+
}
109+
110+
licenses {
111+
license {
112+
name 'The Apache License, Version 2.0'
113+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
114+
}
115+
}
116+
117+
developers {
118+
developer {
119+
id 'ylaupa'
120+
name 'Yorick Laupa'
121+
122+
}
123+
}
67124
}
68-
}
69-
}
70-
publications {
71-
Snapshot(MavenPublication) {
72-
from(components.java)
73125
}
74126
}
75127
}
76128

129+
130+
//publishing {
131+
// publications {
132+
// Snapshot(MavenPublication) {
133+
// from(components.java)
134+
// }
135+
// }
136+
//
137+
// repositories {
138+
// maven {
139+
// url = 'https://oss.sonatype.org/content/repositories/snapshots'
140+
// }
141+
// }
142+
//
143+
//// repositories {
144+
//// maven {
145+
//// name = "GitHubPackages"
146+
//// url = uri("https://maven.pkg.github.com/EventStore/EventStoreDB-Client-Java")
147+
//// credentials {
148+
//// username = System.getenv("GITHUB_ACTOR")
149+
//// password = System.getenv("GITHUB_TOKEN")
150+
//// }
151+
//// }
152+
//// }
153+
//}
154+
77155
sourceCompatibility = JavaVersion.VERSION_1_8
78-
targetCompatibility = JavaVersion.VERSION_1_8
156+
targetCompatibility = JavaVersion.VERSION_1_8

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
* in the user manual at https://docs.gradle.org/6.6.1/userguide/multi_project_builds.html
88
*/
99

10-
rootProject.name = 'EventStoreDB-Client-Java'
10+
rootProject.name = 'eventstore-db-client'
1111
include 'db-client-java'

0 commit comments

Comments
 (0)