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/.gitlab-ci.yml b/.gitlab-ci.yml index b0031710..63be8ec2 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,18 @@ 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/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 diff --git a/dogstatsd-http/core/pom.xml b/dogstatsd-http/core/pom.xml index 271173e3..ad935353 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 @@ -22,23 +22,4 @@ test - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19 - - - diff --git a/dogstatsd-http/forwarder/pom.xml b/dogstatsd-http/forwarder/pom.xml index d8c34732..0d832c30 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 @@ -14,11 +14,15 @@ dogstatsd-http-forwarder HTTP forwarder for DogStatsD metrics. + + 11 + + com.datadoghq dogstatsd-http-core - ${project.version} + ${version} junit @@ -27,23 +31,4 @@ test - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 11 - 11 - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19 - - - diff --git a/dogstatsd-http/pom.xml b/dogstatsd-http/pom.xml index 511494dc..f20963be 100644 --- a/dogstatsd-http/pom.xml +++ b/dogstatsd-http/pom.xml @@ -1,18 +1,21 @@ + 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 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 + 7 @@ -23,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 @@ -37,6 +42,47 @@ + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${maven.compiler.release} + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19 + + + org.codehaus.mojo + flatten-maven-plugin + 1.8.0 + + ossrh + + + + flatten + process-resources + + flatten + + + + flatten.clean + + clean + + + + + + + spotless @@ -68,6 +114,84 @@ + + + deploy-artifacts + + false + + performRelease + true + + + + + + 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 + 0.8.0 + true + + central + validated + dogstatsd-http:${project.version} + + + dogstatsd-http + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + +