From b3fcfcea740ea2e318580798c9ab41f9f14c0ae6 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 13:29:24 +0200 Subject: [PATCH 1/9] Add gitlab release job for dogstatsd-http --- .gitlab-ci.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0031710..f2e56d8e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,7 @@ stages: variables: REGISTRY: registry.ddbuild.io -# From the tagged repo, push the release artifact -deploy_to_sonatype: +.sonatype_release: stage: deploy_to_sonatype rules: @@ -19,6 +18,10 @@ deploy_to_sonatype: image: $REGISTRY/images/mirror/maven:3.9-eclipse-temurin-17 + variables: + # Pom of the project to release, relative to the repository root. + RELEASE_POM: ./pom.xml + script: # Ensure we don't print commands being run to the logs during credential # operations @@ -43,8 +46,12 @@ deploy_to_sonatype: - set -x - - echo "Building release..." - - mvn -DperformRelease=true --settings ./settings.xml clean deploy + - echo "Building release of $RELEASE_POM..." + - mvn -DperformRelease=true --settings ./settings.xml -f "$RELEASE_POM" clean deploy + +# From the tagged repo, push the release artifact +deploy_to_sonatype: + extends: .sonatype_release artifacts: expire_in: 6 mos @@ -57,6 +64,19 @@ deploy_to_sonatype: - ./target/*.sha256 - ./target/*.sha512 +deploy_dogstatsd_http: + extends: .sonatype_release + variables: + RELEASE_POM: ./dogstatsd-http/pom.xml + artifacts: + expire_in: 6 mos + paths: + - ./dogstatsd-http/target/*.asc + - ./dogstatsd-http/core/target/*.jar + - ./dogstatsd-http/core/target/*.asc + - ./dogstatsd-http/forwarder/target/*.jar + - ./dogstatsd-http/forwarder/target/*.asc + # This job creates the GPG key used to sign the releases create_key: stage: create_key From 9226cd0ae7bd4c31ccb7bd63ec9df3957dbda73f Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 13:54:58 +0200 Subject: [PATCH 2/9] Set the version once --- dogstatsd-http/core/pom.xml | 2 +- dogstatsd-http/forwarder/pom.xml | 4 ++-- dogstatsd-http/pom.xml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dogstatsd-http/core/pom.xml b/dogstatsd-http/core/pom.xml index 271173e3..2b323aa1 100644 --- a/dogstatsd-http/core/pom.xml +++ b/dogstatsd-http/core/pom.xml @@ -6,7 +6,7 @@ com.datadoghq dogstatsd-http - 1.0.0-SNAPSHOT + ${version} dogstatsd-http-core diff --git a/dogstatsd-http/forwarder/pom.xml b/dogstatsd-http/forwarder/pom.xml index d8c34732..9ef07dd8 100644 --- a/dogstatsd-http/forwarder/pom.xml +++ b/dogstatsd-http/forwarder/pom.xml @@ -6,7 +6,7 @@ com.datadoghq dogstatsd-http - 1.0.0-SNAPSHOT + ${version} dogstatsd-http-forwarder @@ -18,7 +18,7 @@ com.datadoghq dogstatsd-http-core - ${project.version} + ${version} junit diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index 511494dc..171496e6 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -7,11 +7,12 @@ dogstatsd-http pom dogstatsd-http - 1.0.0-SNAPSHOT + ${version} Aggregator for the DogStatsD HTTP client modules. https://github.com/DataDog/java-dogstatsd-client + 1.0.0-SNAPSHOT UTF-8 From a1b18268a215bd9e2276c2911fcb7d1acbae0fb2 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 13:56:08 +0200 Subject: [PATCH 3/9] Flatten released poms Re-write relased artifact poms to contain only neecessary information and render any variables defined in the parent. --- .gitignore | 2 ++ dogstatsd-http/pom.xml | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/.gitignore b/.gitignore index 93ec4c02..238168df 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ target/ # rbenv for pimpmychangelog .ruby-version + +.flattened-pom.xml diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index 171496e6..172d1e96 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -38,6 +38,34 @@ + + + + org.codehaus.mojo + flatten-maven-plugin + 1.8.0 + + ossrh + + + + flatten + process-resources + + flatten + + + + flatten.clean + + clean + + + + + + + spotless From 1a2c4418d966224dc0cd424b6cff838b3e4bf2b2 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 14:20:17 +0200 Subject: [PATCH 4/9] Add deploy configuration --- dogstatsd-http/pom.xml | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index 172d1e96..8bac4bd6 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -97,6 +97,52 @@ + + + deploy-artifacts + + false + + performRelease + true + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + central + validated + dogstatsd-http:${project.version} + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + From 3ddb2b6d78b7aecccba0909507c6e8f17dd91622 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 15:16:45 +0200 Subject: [PATCH 5/9] Host compiler plugin definition --- dogstatsd-http/core/pom.xml | 9 --------- dogstatsd-http/forwarder/pom.xml | 13 ++++--------- dogstatsd-http/pom.xml | 9 +++++++++ 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/dogstatsd-http/core/pom.xml b/dogstatsd-http/core/pom.xml index 2b323aa1..509cd871 100644 --- a/dogstatsd-http/core/pom.xml +++ b/dogstatsd-http/core/pom.xml @@ -25,15 +25,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.7 - 1.7 - - org.apache.maven.plugins maven-surefire-plugin diff --git a/dogstatsd-http/forwarder/pom.xml b/dogstatsd-http/forwarder/pom.xml index 9ef07dd8..dac22197 100644 --- a/dogstatsd-http/forwarder/pom.xml +++ b/dogstatsd-http/forwarder/pom.xml @@ -14,6 +14,10 @@ dogstatsd-http-forwarder HTTP forwarder for DogStatsD metrics. + + 11 + + com.datadoghq @@ -30,15 +34,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 11 - 11 - - org.apache.maven.plugins maven-surefire-plugin diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index 8bac4bd6..8eabb5fc 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -14,6 +14,7 @@ 1.0.0-SNAPSHOT UTF-8 + 7 @@ -40,6 +41,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${maven.compiler.release} + + org.codehaus.mojo flatten-maven-plugin From a5c8d7d60ff5623868ec10cd2afe7cecd3883a27 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 15:17:44 +0200 Subject: [PATCH 6/9] Host surefire plugin definition --- dogstatsd-http/core/pom.xml | 10 ---------- dogstatsd-http/forwarder/pom.xml | 10 ---------- dogstatsd-http/pom.xml | 5 +++++ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/dogstatsd-http/core/pom.xml b/dogstatsd-http/core/pom.xml index 509cd871..ad935353 100644 --- a/dogstatsd-http/core/pom.xml +++ b/dogstatsd-http/core/pom.xml @@ -22,14 +22,4 @@ test - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19 - - - diff --git a/dogstatsd-http/forwarder/pom.xml b/dogstatsd-http/forwarder/pom.xml index dac22197..0d832c30 100644 --- a/dogstatsd-http/forwarder/pom.xml +++ b/dogstatsd-http/forwarder/pom.xml @@ -31,14 +31,4 @@ test - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19 - - - diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index 8eabb5fc..dd86af3e 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -49,6 +49,11 @@ ${maven.compiler.release} + + org.apache.maven.plugins + maven-surefire-plugin + 2.19 + org.codehaus.mojo flatten-maven-plugin From 931d0c0c80c937dafb3997fff123fc4df4302948 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 16:07:19 +0200 Subject: [PATCH 7/9] Bundle sources and javadoc with the release --- dogstatsd-http/pom.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index dd86af3e..9f4be390 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -123,6 +123,32 @@ + + org.apache.maven.plugins + maven-source-plugin + 2.4 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.0 + + + attach-javadocs + + jar + + + + org.sonatype.central central-publishing-maven-plugin From 96d6949d70a3072e06dea41c2feab88451f88e3b Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 16:11:23 +0200 Subject: [PATCH 8/9] Don't append module name to project and scm urls --- dogstatsd-http/pom.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index 9f4be390..4f556857 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -1,6 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" + child.project.url.inherit.append.path="false"> 4.0.0 com.datadoghq @@ -25,7 +26,9 @@ - + https://github.com/DataDog/java-dogstatsd-client scm:git:git@github.com:DataDog/java-dogstatsd-client.git scm:git:git@github.com:Datadog/java-dogstatsd-client.git From 192a34d89f6d9ea94b2eddf376fa9e6e5628e798 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 16:23:33 +0200 Subject: [PATCH 9/9] Exclude parent artifact from deploy --- .gitlab-ci.yml | 1 - dogstatsd-http/pom.xml | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2e56d8e..63be8ec2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,7 +71,6 @@ deploy_dogstatsd_http: artifacts: expire_in: 6 mos paths: - - ./dogstatsd-http/target/*.asc - ./dogstatsd-http/core/target/*.jar - ./dogstatsd-http/core/target/*.asc - ./dogstatsd-http/forwarder/target/*.jar diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index 4f556857..f20963be 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -161,6 +161,12 @@ central validated dogstatsd-http:${project.version} + + + dogstatsd-http +