Skip to content

Commit

Permalink
build: fixes animal-sniffer phase and runs on all JDKs (#1389)
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt authored Dec 18, 2023
1 parent 677244a commit 90537d6
Show file tree
Hide file tree
Showing 30 changed files with 98 additions and 49 deletions.
4 changes: 3 additions & 1 deletion brave/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

<!-- disable errorprone cast warning as PendingSpans internally hacks equals -->
<errorprone.args>-Xep:EqualsUnsafeCast:OFF</errorprone.args>

<!-- The brave jar needs to be Java 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -134,7 +137,6 @@
<properties>
<!-- The brave jar needs to be Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion brave/src/main/java/brave/internal/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public Clock clock() {
}

static class Jre9 extends Jre7 {
@Override public long currentTimeMicroseconds() {
@IgnoreJRERequirement @Override public long currentTimeMicroseconds() {
java.time.Instant instant = java.time.Clock.systemUTC().instant();
return (instant.getEpochSecond() * 1000000) + (instant.getNano() / 1000);
}
Expand Down
22 changes: 13 additions & 9 deletions context/jfr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,22 @@
<module.name>brave.context.jfr</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>
<!-- for add-modules -->
<main.java.version>11</main.java.version>
<!-- 12 not 11 as there is no java11 published -->
<main.signature.artifact>java12</main.signature.artifact>
</properties>

<dependencies>
<dependency>
<groupId>org.jvnet</groupId>
<artifactId>animal-sniffer-annotation</artifactId>
<version>1.0</version>
<!-- annotations are not runtime retention, so don't need a runtime dep -->
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand All @@ -45,15 +58,6 @@
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2020 The OpenZipkin Authors
* Copyright 2013-2023 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -13,15 +13,16 @@
*/
package brave.context.jfr;

import brave.internal.Nullable;
import brave.baggage.BaggageFields;
import brave.internal.Nullable;
import brave.propagation.CurrentTraceContext.Scope;
import brave.propagation.CurrentTraceContext.ScopeDecorator;
import brave.propagation.TraceContext;
import jdk.jfr.Category;
import jdk.jfr.Description;
import jdk.jfr.Event;
import jdk.jfr.Label;
import org.jvnet.animal_sniffer.IgnoreJRERequirement;

/**
* Adds {@linkplain Event} properties "traceId", "parentId" and "spanId" when a {@link
Expand Down Expand Up @@ -55,6 +56,7 @@ public static ScopeDecorator get() {
@Category("Zipkin")
@Label("Scope")
@Description("Zipkin event representing a span being placed in scope")
@IgnoreJRERequirement
static final class ScopeEvent extends Event {
@Label("Trace Id") String traceId;
@Label("Parent Id") String parentId;
Expand Down
4 changes: 3 additions & 1 deletion context/log4j12/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<module.name>brave.context.log4j12</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>

<!-- log4j is Java 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand All @@ -47,7 +50,6 @@
<properties>
<!-- log4j is Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion context/log4j2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<module.name>brave.context.log4j2</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>

<!-- log4j2 <= 2.3.2 is 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand All @@ -47,7 +50,6 @@
<properties>
<!-- log4j2 <= 2.3.2 is 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion context/rxjava2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<module.name>brave.context.rxjava2</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>

<!-- RxJava 2.x continues support for Java 1.6 and Android 2.3+ -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -66,7 +69,6 @@
<properties>
<!-- RxJava 2.x continues support for Java 1.6 and Android 2.3+ -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion context/slf4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<module.name>brave.context.slf4j</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>

<!-- SLF4J is 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand All @@ -47,7 +50,6 @@
<properties>
<!-- SLF4J is 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/dubbo-rpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.math=ALL-UNNAMED
</maven-failsafe-plugin.argLine>

<!-- Dubbo is 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -81,7 +84,6 @@
<properties>
<!-- Dubbo is 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<!-- disable mutability warning as TagContextBinaryMarshaller intentionally returns mixed -->
<errorprone.args>-Xep:MixedMutabilityReturnType:OFF</errorprone.args>

<!-- grpc-java < 1.15 supports Java 6 https://github.com/grpc/grpc-java/issues/3961 Current versions support Java 7 even though TLS typically implies Java 8+ -->
<main.signature.artifact>java16</main.signature.artifact>

<build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
</properties>

Expand Down Expand Up @@ -124,7 +127,6 @@
<properties>
<!-- grpc-java < 1.15 supports Java 6 https://github.com/grpc/grpc-java/issues/3961 Current versions support Java 7 even though TLS typically implies Java 8+ -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
11 changes: 0 additions & 11 deletions instrumentation/http-tests-jakarta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

<properties>
<main.basedir>${project.basedir}/../..</main.basedir>
<main.java.version>11</main.java.version>
<main.signature.artifact>java18</main.signature.artifact>
<!-- disable errorprone warning that "return this" is not synchronized! -->
<errorprone.args>-Xep:UnsynchronizedOverridesSynchronized:OFF</errorprone.args>
</properties>
Expand Down Expand Up @@ -88,15 +86,6 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
4 changes: 3 additions & 1 deletion instrumentation/http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<module.name>brave.http</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>

<!-- The brave jar needs to be Java 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand All @@ -55,7 +58,6 @@
<properties>
<!-- The brave jar needs to be Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/httpasyncclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<module.name>brave.httpasyncclient</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>

<!-- httpasyncclient Java 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -59,7 +62,6 @@
<properties>
<!-- httpasyncclient Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/httpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<main.basedir>${project.basedir}/../..</main.basedir>

<old-httpclient.version>4.3.6</old-httpclient.version>

<!-- httpclient is Java 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -105,7 +108,6 @@
<properties>
<!-- httpclient is Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/httpclient5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

<!-- To obey the integration tests, we need to use the version >= 5.2 -->
<httpclient5.version>5.3</httpclient5.version>

<!-- HttpClient 5 is Java 1.7 bytecode -->
<main.signature.artifact>java17</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -68,7 +71,6 @@
<properties>
<!-- HttpClient 5 is Java 1.7 bytecode -->
<main.java.version>1.7</main.java.version>
<main.signature.artifact>java17</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/jaxrs2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<module.name>brave.jaxrs2</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>

<!-- JAXRS2 is Java 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -104,7 +107,6 @@
<properties>
<!-- JAXRS2 is Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/jms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@

<!-- disable errorprone override warning as we do this intentionally to allow JMS 1.1 -->
<errorprone.args>-Xep:MissingOverride:OFF</errorprone.args>

<!-- JMS is Java 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -113,7 +116,6 @@
<properties>
<!-- JMS is Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/messaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

<properties>
<main.basedir>${project.basedir}/../..</main.basedir>

<!-- The brave jar needs to be Java 1.6 bytecode -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -72,7 +75,6 @@
<properties>
<!-- The brave jar needs to be Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<main.basedir>${project.basedir}/../..</main.basedir>

<mongodb-driver.version>3.12.14</mongodb-driver.version>

<!-- mongodb-driver 3.x requires Java 6 -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -61,7 +64,6 @@
<properties>
<!-- mongodb-driver 3.x requires Java 6 -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<module.name>brave.mysql</module.name>

<main.basedir>${project.basedir}/../..</main.basedir>

<!-- mysql-connector-java < v6 requires Java 6 -->
<main.signature.artifact>java16</main.signature.artifact>
</properties>

<dependencies>
Expand All @@ -54,7 +57,6 @@
<properties>
<!-- mysql-connector-java < v6 requires Java 6 -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
Expand Down
Loading

0 comments on commit 90537d6

Please sign in to comment.