Skip to content

Commit 46513c0

Browse files
authored
Merge pull request #38 from GoogleCloudPlatform/publishing
Publish to dedicated Artifact Registry instead of Maven Central
2 parents 6786818 + 882fae0 commit 46513c0

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

lib/build.gradle

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414

1515
plugins {
1616
id 'java-library'
17+
// TODO upgrade this to https://plugins.gradle.org/plugin/com.gradleup.shadow
1718
id 'com.github.johnrengelman.shadow' version '7.1.2'
1819
id 'com.github.sherter.google-java-format' version '0.9'
1920
id 'checkstyle'
2021
id 'maven-publish'
2122
id 'signing'
23+
24+
// v"2.2.5" is recommended, but it uses Java21 which is incompatible with other
25+
// plugins (e.g. "com.github.johnrengelman.shadow"), therefore, using latest compatible version
26+
id("com.google.cloud.artifactregistry.gradle-plugin") version "2.1.5"
2227
}
2328

2429
googleJavaFormat {
@@ -144,7 +149,7 @@ java {
144149
publishing {
145150
publications {
146151
mavenJava(MavenPublication) {
147-
version = '1.0.0'
152+
version = '1.1.0'
148153
group = 'com.google.cloud.datalineage'
149154
artifactId = 'producerclient'
150155

@@ -179,6 +184,16 @@ publishing {
179184
name = 'Natalia Gorchakova'
180185
181186
}
187+
developer {
188+
id = 'mikhalevich'
189+
name = 'Konstantin Mikhalevich'
190+
191+
}
192+
developer {
193+
id = 'wojtekl'
194+
name = 'Wojciech Łowiec'
195+
196+
}
182197
}
183198
scm {
184199
connection = 'scm:git:https://github.com/GoogleCloudPlatform/data-lineage-producer-java-library.git'
@@ -190,23 +205,11 @@ publishing {
190205
}
191206
repositories {
192207
maven {
193-
def releasesRepoUrl = 'https://google.oss.sonatype.org/service/local/staging/deploy/maven2/'
194-
def snapshotsRepoUrl = 'https://google.oss.sonatype.org/content/repositories/snapshots/'
195-
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
196-
credentials {
197-
// TODO: set those with your https://google.oss.sonatype.org OSSRH server user token.
198-
username = 'secret'
199-
password = 'secret'
200-
}
208+
url "artifactregistry://us-central1-maven.pkg.dev/dataplex-gob-louhi-releaser/cloud-dataplex-maven-releases"
201209
}
202210
}
203211
}
204212

205-
signing {
206-
sign publishing.publications.mavenJava
207-
}
208-
209-
210213
javadoc {
211214
if (JavaVersion.current().isJava9Compatible()) {
212215
options.addBooleanOption('html5', true)

0 commit comments

Comments
 (0)