Skip to content

Commit daf3628

Browse files
authored
clean up maven (#1145)
* clean up maven Signed-off-by: Gregor Zeitlinger <[email protected]> * clean up maven Signed-off-by: Gregor Zeitlinger <[email protected]> --------- Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent d921935 commit daf3628

File tree

10 files changed

+28
-89
lines changed

10 files changed

+28
-89
lines changed

examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
Part of a distributed "Hello, World" REST service to show Exemplars with OpenTelemetry's distributed tracing
1616
</description>
1717

18+
<properties>
19+
<java.version>17</java.version>
20+
</properties>
21+
1822
<dependencies>
1923
<dependency>
2024
<groupId>io.prometheus</groupId>
@@ -41,19 +45,6 @@
4145
<build>
4246
<finalName>${project.artifactId}</finalName>
4347
<plugins>
44-
<plugin>
45-
<artifactId>maven-compiler-plugin</artifactId>
46-
<configuration>
47-
<release>17</release>
48-
<source>17</source>
49-
<target>17</target>
50-
<showWarnings>true</showWarnings>
51-
<compilerArgs>
52-
<arg>-Xlint:all</arg>
53-
<arg>-Werror</arg>
54-
</compilerArgs>
55-
</configuration>
56-
</plugin>
5748
<plugin>
5849
<groupId>org.apache.maven.plugins</groupId>
5950
<artifactId>maven-shade-plugin</artifactId>

examples/example-exemplars-tail-sampling/example-greeting-service/src/main/java/io/prometheus/metrics/examples/otel_exemplars/greeting/GreetingServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public GreetingServlet() {
3434
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
3535
long start = System.nanoTime();
3636
try {
37-
Thread.sleep((long) (Math.abs((random.nextGaussian() + 1.0) * 100.0)));
37+
Thread.sleep((long) Math.abs((random.nextGaussian() + 1.0) * 100.0));
3838
resp.setStatus(200);
3939
resp.setContentType("text/plain");
4040
resp.getWriter().println("Hello, World!");

examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
Part of a distributed "Hello, World" REST service to show Exemplars with OpenTelemetry's distributed tracing
1616
</description>
1717

18+
<properties>
19+
<java.version>17</java.version>
20+
</properties>
21+
1822
<dependencies>
1923
<dependency>
2024
<groupId>io.prometheus</groupId>
@@ -41,19 +45,6 @@
4145
<build>
4246
<finalName>${project.artifactId}</finalName>
4347
<plugins>
44-
<plugin>
45-
<artifactId>maven-compiler-plugin</artifactId>
46-
<configuration>
47-
<release>17</release>
48-
<source>17</source>
49-
<target>17</target>
50-
<showWarnings>true</showWarnings>
51-
<compilerArgs>
52-
<arg>-Xlint:all</arg>
53-
<arg>-Werror</arg>
54-
</compilerArgs>
55-
</configuration>
56-
</plugin>
5748
<plugin>
5849
<groupId>org.apache.maven.plugins</groupId>
5950
<artifactId>maven-shade-plugin</artifactId>

examples/example-exemplars-tail-sampling/example-hello-world-app/src/main/java/io/prometheus/metrics/examples/otel_exemplars/app/HelloWorldServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public HelloWorldServlet() {
4141
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
4242
long start = System.nanoTime();
4343
try {
44-
Thread.sleep((long) (Math.abs((random.nextGaussian() + 1.0) * 100.0)));
44+
Thread.sleep((long) Math.abs((random.nextGaussian() + 1.0) * 100.0));
4545
String greeting = executeGreetingServiceRequest();
4646
resp.setStatus(200);
4747
resp.setContentType("text/plain");

examples/example-exemplars-tail-sampling/pom.xml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,12 @@
1616
Example project showing Examplars with OpenTelemetry's Tail Sampling.
1717
</description>
1818

19+
<properties>
20+
<java.version>11</java.version>
21+
</properties>
22+
1923
<modules>
2024
<module>example-greeting-service</module>
2125
<module>example-hello-world-app</module>
2226
</modules>
23-
24-
<build>
25-
<plugins>
26-
<plugin>
27-
<artifactId>maven-compiler-plugin</artifactId>
28-
<configuration>
29-
<source>11</source>
30-
<target>11</target>
31-
</configuration>
32-
</plugin>
33-
</plugins>
34-
</build>
3527
</project>

examples/example-exporter-servlet-tomcat/pom.xml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
Prometheus Metrics Example using Embedded Tomcat and the Exporter Servlet
1616
</description>
1717

18+
<properties>
19+
<java.version>17</java.version>
20+
</properties>
21+
1822
<dependencies>
1923
<dependency>
2024
<groupId>io.prometheus</groupId>
@@ -41,19 +45,6 @@
4145
<build>
4246
<finalName>${project.artifactId}</finalName>
4347
<plugins>
44-
<plugin>
45-
<artifactId>maven-compiler-plugin</artifactId>
46-
<configuration>
47-
<release>17</release>
48-
<source>17</source>
49-
<target>17</target>
50-
<showWarnings>true</showWarnings>
51-
<compilerArgs>
52-
<arg>-Xlint:all</arg>
53-
<arg>-Werror</arg>
54-
</compilerArgs>
55-
</configuration>
56-
</plugin>
5748
<plugin>
5849
<groupId>org.apache.maven.plugins</groupId>
5950
<artifactId>maven-shade-plugin</artifactId>

examples/example-exporter-servlet-tomcat/src/main/java/io/prometheus/metrics/examples/tomcat_servlet/HelloWorldServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public HelloWorldServlet() {
4444
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
4545
long start = System.nanoTime();
4646
try {
47-
Thread.sleep((long) (Math.abs((random.nextGaussian() + 1.0) * 100.0)));
47+
Thread.sleep((long) Math.abs((random.nextGaussian() + 1.0) * 100.0));
4848
resp.setStatus(200);
4949
resp.setContentType("text/plain");
5050
resp.getWriter().println("Hello, World!");

integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/pom.xml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
Tomcat Sample for the Exporter Integration Test
1616
</description>
1717

18+
<properties>
19+
<java.version>17</java.version>
20+
</properties>
21+
1822
<dependencies>
1923
<dependency>
2024
<groupId>io.prometheus</groupId>
@@ -36,19 +40,6 @@
3640
<build>
3741
<finalName>exporter-servlet-tomcat-sample</finalName>
3842
<plugins>
39-
<plugin>
40-
<artifactId>maven-compiler-plugin</artifactId>
41-
<configuration>
42-
<release>17</release>
43-
<source>17</source>
44-
<target>17</target>
45-
<showWarnings>true</showWarnings>
46-
<compilerArgs>
47-
<arg>-Xlint:all</arg>
48-
<arg>-Werror</arg>
49-
</compilerArgs>
50-
</configuration>
51-
</plugin>
5243
<plugin>
5344
<groupId>org.apache.maven.plugins</groupId>
5445
<artifactId>maven-shade-plugin</artifactId>

pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<automatic.module.name>--module-name-need-to-be-overriden--</automatic.module.name>
2020
<junit-jupiter.version>5.11.2</junit-jupiter.version>
2121
<otel.version>1.42.1</otel.version>
22+
<java.version>8</java.version>
2223
</properties>
2324

2425
<licenses>
@@ -270,9 +271,9 @@
270271
<plugin>
271272
<artifactId>maven-compiler-plugin</artifactId>
272273
<configuration>
273-
<release>8</release>
274-
<source>8</source>
275-
<target>8</target>
274+
<release>${java.version}</release>
275+
<source>${java.version}</source>
276+
<target>${java.version}</target>
276277
<showWarnings>true</showWarnings>
277278
<compilerArgs>
278279
<arg>-Xlint:all</arg>

prometheus-metrics-exporter-servlet-jakarta/pom.xml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
<properties>
2121
<automatic.module.name>io.prometheus.metrics.exporter.servlet.jakarta</automatic.module.name>
22+
<java.version>17</java.version>
2223
</properties>
2324

2425
<dependencies>
@@ -34,23 +35,4 @@
3435
<scope>provided</scope>
3536
</dependency>
3637
</dependencies>
37-
38-
<build>
39-
<plugins>
40-
<plugin>
41-
<artifactId>maven-compiler-plugin</artifactId>
42-
<configuration>
43-
<release>17</release>
44-
<source>17</source>
45-
<target>17</target>
46-
<showWarnings>true</showWarnings>
47-
<compilerArgs>
48-
<arg>-Xlint:all</arg>
49-
<arg>-Werror</arg>
50-
</compilerArgs>
51-
</configuration>
52-
</plugin>
53-
</plugins>
54-
</build>
55-
5638
</project>

0 commit comments

Comments
 (0)