From fe44e3c18ab1fb6d1383e7b6ddefc065d251809d Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 28 May 2026 17:07:11 -0400 Subject: [PATCH] client/java: maven-publish wiring for Gitea Maven feed --- clients/java/README.md | 31 ++++++++++++++ clients/java/build.gradle | 40 +++++++++++++++++++ .../zb-mom-ww-mxgateway-client/build.gradle | 6 +++ 3 files changed, 77 insertions(+) diff --git a/clients/java/README.md b/clients/java/README.md index 7417d12..36f4486 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -282,6 +282,37 @@ $env:MXGATEWAY_TEST_ITEM = 'TestObject.TestInt' gradle :zb-mom-ww-mxgateway-cli:run --args="smoke --endpoint $env:MXGATEWAY_ENDPOINT --plaintext --api-key-env MXGATEWAY_API_KEY --item $env:MXGATEWAY_TEST_ITEM --json" ``` +## Installing from the Gitea Maven repository + +The client publishes to the internal Gitea Maven repository at +`https://gitea.dohertylan.com/api/packages/dohertj2/maven`. + +In your consumer project's `build.gradle`: + +````groovy +repositories { + maven { + url 'https://gitea.dohertylan.com/api/packages/dohertj2/maven' + credentials { + username = System.getenv('GITEA_USERNAME') + password = System.getenv('GITEA_TOKEN') + } + } +} + +dependencies { + implementation 'com.zb.mom.ww.mxgateway:zb-mom-ww-mxgateway-client:0.1.0' +} +```` + +To publish a new version from this repo: + +````bash +export GITEA_USERNAME=dohertj2 +export GITEA_TOKEN= +gradle :zb-mom-ww-mxgateway-client:publish +```` + ## Related Documentation - [Client Packaging](../../docs/ClientPackaging.md) diff --git a/clients/java/build.gradle b/clients/java/build.gradle index 4a4db6a..f21bc34 100644 --- a/clients/java/build.gradle +++ b/clients/java/build.gradle @@ -37,4 +37,44 @@ subprojects { testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } } + + pluginManager.withPlugin('maven-publish') { + publishing { + publications { + maven(MavenPublication) { + from components.java + pom { + url = 'https://gitea.dohertylan.com/dohertj2/mxaccessgw' + description = 'MxAccessGateway Java client' + scm { + url = 'https://gitea.dohertylan.com/dohertj2/mxaccessgw' + connection = 'scm:git:https://gitea.dohertylan.com/dohertj2/mxaccessgw.git' + } + developers { + developer { + id = 'dohertj2' + name = 'Joseph Doherty' + } + } + licenses { + license { + name = 'Proprietary' + distribution = 'repo' + } + } + } + } + } + repositories { + maven { + name = 'GiteaPackages' + url = 'https://gitea.dohertylan.com/api/packages/dohertj2/maven' + credentials { + username = System.getenv('GITEA_USERNAME') ?: '' + password = System.getenv('GITEA_TOKEN') ?: '' + } + } + } + } + } } diff --git a/clients/java/zb-mom-ww-mxgateway-client/build.gradle b/clients/java/zb-mom-ww-mxgateway-client/build.gradle index 57789c6..aea6eef 100644 --- a/clients/java/zb-mom-ww-mxgateway-client/build.gradle +++ b/clients/java/zb-mom-ww-mxgateway-client/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'com.google.protobuf' + id 'maven-publish' } dependencies { @@ -30,6 +31,11 @@ sourceSets { } } +java { + withSourcesJar() + withJavadocJar() +} + protobuf { protoc { artifact = "com.google.protobuf:protoc:${protobufVersion}"