Skip to content

Commit

Permalink
Refactored build to publish collector jar to Maven Central (#1088)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoard authored Dec 6, 2024
1 parent 74fa0f0 commit 7f003f7
Show file tree
Hide file tree
Showing 8 changed files with 278 additions and 100 deletions.
132 changes: 122 additions & 10 deletions collector/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.prometheus.jmx</groupId>
<artifactId>parent</artifactId>
<version>1.1.0-post</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>io.prometheus.jmx</groupId>
<artifactId>collector</artifactId>
<version>1.1.0</version>
<packaging>jar</packaging>
<name>Prometheus JMX Exporter - Collector</name>
<description>
See https://github.com/prometheus/jmx_exporter/blob/master/README.md
</description>
<description>See https://github.com/prometheus/jmx_exporter/blob/main/README.md</description>
<url>https://github.com/prometheus/jmx_exporter</url>

<licenses>
Expand All @@ -23,11 +18,60 @@
</license>
</licenses>

<developers>
<developer>
<name>Doug Hoard</name>
<email>[email protected]</email>
</developer>
<developer>
<name>Fabian Stäber</name>
<email>[email protected]</email>
</developer>
</developers>

<scm>
<connection>scm:git:[email protected]:prometheus/jmx_exporter.git</connection>
<developerConnection>scm:git:[email protected]:prometheus/jmx_exporter.git</developerConnection>
<url>[email protected]:prometheus/jmx_exporter.git</url>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<prometheus.metrics.version>1.3.4</prometheus.metrics.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>prometheus-metrics-core</artifactId>
<version>${prometheus.metrics.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>prometheus-metrics-model</artifactId>
<version>${prometheus.metrics.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>prometheus-metrics-instrumentation-jvm</artifactId>
<version>${prometheus.metrics.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>prometheus-metrics-exporter-httpserver</artifactId>
<version>${prometheus.metrics.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>prometheus-metrics-exporter-opentelemetry</artifactId>
<version>${prometheus.metrics.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.prometheus</groupId>
Expand Down Expand Up @@ -81,6 +125,7 @@
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<configuration>
<java>
<googleJavaFormat>
Expand Down Expand Up @@ -131,4 +176,71 @@
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>false</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
25 changes: 21 additions & 4 deletions integration_test_suite/integration_tests/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.prometheus.jmx</groupId>
<artifactId>integration_test_suite</artifactId>
<version>1.1.0-post</version>
<version>1.1.0</version>
</parent>

<artifactId>integration_tests</artifactId>
<name>Prometheus JMX Exporter - Integration Tests</name>
<description>
See https://github.com/prometheus/jmx_exporter/blob/master/README.md
</description>
<description>See https://github.com/prometheus/jmx_exporter/blob/main/README.md</description>
<url>https://github.com/prometheus/jmx_exporter</url>

<licenses>
Expand Down Expand Up @@ -186,4 +185,22 @@
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.3</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
27 changes: 21 additions & 6 deletions integration_test_suite/jmx_example_application/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.prometheus.jmx</groupId>
<artifactId>integration_test_suite</artifactId>
<version>1.1.0-post</version>
<version>1.1.0</version>
</parent>

<artifactId>jmx_example_application</artifactId>
<name>Prometheus JMX Exporter - JMX Example Application</name>
<description>
See https://github.com/prometheus/jmx_exporter/blob/master/README.md
</description>
<description>See https://github.com/prometheus/jmx_exporter/blob/main/README.md</description>
<url>https://github.com/prometheus/jmx_exporter</url>

<licenses>
Expand Down Expand Up @@ -141,4 +138,22 @@
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.3</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
41 changes: 23 additions & 18 deletions integration_test_suite/pom.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<modelVersion>4.0.0</modelVersion>
<groupId>io.prometheus.jmx</groupId>
<artifactId>integration_test_suite</artifactId>
<version>1.1.0-post</version>
<version>1.1.0</version>
<name>Prometheus JMX Exporter - Integration Test Suite</name>
<description>
See https://github.com/prometheus/jmx_exporter/blob/master/README.md
</description>

<description>See https://github.com/prometheus/jmx_exporter/blob/main/README.md</description>
<url>https://github.com/prometheus/jmx_exporter</url>

<packaging>pom</packaging>

<licenses>
Expand All @@ -23,6 +19,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<prometheus.metrics.version>1.3.4</prometheus.metrics.version>
</properties>

Expand All @@ -34,10 +31,6 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.3</version>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
Expand All @@ -63,16 +56,10 @@
<compilerArgument>-Xbootclasspath/a:${env.JAVA_HOME}/lib/</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<configuration>
<java>
<googleJavaFormat>
Expand Down Expand Up @@ -114,4 +101,22 @@
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.3</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
30 changes: 23 additions & 7 deletions jmx_prometheus_common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.prometheus.jmx</groupId>
<artifactId>parent</artifactId>
<version>1.1.0-post</version>
<artifactId>jmx_exporter</artifactId>
<version>1.1.0</version>
</parent>

<artifactId>jmx_prometheus_common</artifactId>
<name>Prometheus JMX Exporter - Common</name>
<description>
See https://github.com/prometheus/jmx_exporter/blob/master/README.md
</description>
<description>See https://github.com/prometheus/jmx_exporter/blob/main/README.md</description>
<url>https://github.com/prometheus/jmx_exporter</url>

<licenses>
Expand Down Expand Up @@ -78,6 +75,7 @@
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<configuration>
<java>
<googleJavaFormat>
Expand Down Expand Up @@ -119,4 +117,22 @@
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.3</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Loading

0 comments on commit 7f003f7

Please sign in to comment.