Skip to content

Commit

Permalink
Makes all except core jar Java 11+ (#3666)
Browse files Browse the repository at this point in the history
This moves all code to minimum Java 11, except the core jar, which
remains (mostly) Java 1.6 for use in zipkin-reporter.

Notably, this pushes animal-sniffer to the core module, as the others
can rely on the release property of modern compilers.

Java 11 instead of 11 or 21 because that's the last SDK that can also
compile 1.6.

Note: this bumps to the next minor as it is worth communicating.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt authored Dec 29, 2023
1 parent 68d77db commit 77869db
Show file tree
Hide file tree
Showing 34 changed files with 195 additions and 161 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Note: The above is just an example, most likely you'll want to use an existing t
## Storage Component
Zipkin includes a [StorageComponent](zipkin/src/main/java/zipkin2/storage/StorageComponent.java), used to store and query spans and
dependency links. This is used by the server and those making collectors, or span reporters. For this reason, storage
components have minimal dependencies, but most require Java 8+
components have minimal dependencies, but most require Java 11+

Ex.
```java
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin</groupId>
<artifactId>zipkin-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>benchmarks</artifactId>
Expand Down
56 changes: 11 additions & 45 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<groupId>io.zipkin</groupId>
<artifactId>zipkin-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
Expand All @@ -39,13 +39,16 @@
<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- default bytecode version for src/main -->
<main.java.version>1.8</main.java.version>
<main.signature.artifact>java18</main.signature.artifact>
<!-- Except for the module named zipkin, all source is Java 11 -->
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<!-- We don't use animal-sniffer anymore as release obviates it.
See https://github.com/mojohaus/animal-sniffer/issues/62 -->
<maven.compiler.release>11</maven.compiler.release>

<!-- override to set exclusions per-project -->
<errorprone.args />
<errorprone.version>2.23.0</errorprone.version>
<errorprone.version>2.24.0</errorprone.version>

<zipkin-proto3.version>1.0.0</zipkin-proto3.version>

Expand All @@ -56,10 +59,10 @@
<netty.version>4.1.100.Final</netty.version>

<!-- It's easy for Jackson dependencies to get misaligned, so we manage it ourselves. -->
<jackson.version>2.16.0</jackson.version>
<jackson.version>2.16.1</jackson.version>

<java-driver.version>4.18.0</java-driver.version>
<micrometer.version>1.12.0</micrometer.version>
<micrometer.version>1.12.1</micrometer.version>

<!-- Used for Generated annotations -->
<javax-annotation-api.version>1.3.1</javax-annotation-api.version>
Expand All @@ -73,7 +76,7 @@
MariaDB has a friendlier license, LGPL, which is less scary in audits.
-->
<mariadb-java-client.version>3.3.1</mariadb-java-client.version>
<mariadb-java-client.version>3.3.2</mariadb-java-client.version>
<HikariCP.version>5.1.0</HikariCP.version>
<slf4j.version>1.7.36</slf4j.version>
<auto-value.version>1.10.4</auto-value.version>
Expand Down Expand Up @@ -228,13 +231,6 @@
<configuration>
<!-- Add dependencies indirectly referenced by build plugins -->
<dynamicDependencies>
<DynamicDependency>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>${main.signature.artifact}</artifactId>
<version>1.0</version>
<type>signature</type>
<repositoryType>MAIN</repositoryType>
</DynamicDependency>
<DynamicDependency>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin-git</artifactId>
Expand Down Expand Up @@ -262,10 +258,7 @@
<version>${maven-compiler-plugin.version}</version>
<inherited>true</inherited>
<configuration>
<source>${main.java.version}</source>
<target>${main.java.version}</target>
<fork>true</fork>
<release>8</release>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
Expand Down Expand Up @@ -404,31 +397,6 @@
<version>${maven-help-plugin.version}</version>
</plugin>

<!-- Top-level to ensure our server can use JRE 8
(by checking we don't accidentally use later apis) -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>${animal-sniffer-maven-plugin.version}</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>${main.signature.artifact}</artifactId>
<version>1.0</version>
</signature>
<checkTestClasses>false</checkTestClasses>
</configuration>
<executions>
<execution>
<id>animal-sniffer</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
Expand Down Expand Up @@ -661,8 +629,6 @@
<version>${maven-compiler-plugin.version}</version>
<inherited>true</inherited>
<configuration>
<source>${main.java.version}</source>
<target>${main.java.version}</target>
<fork>true</fork>
<showWarnings>true</showWarnings>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Modules here implement popular transport options available by default in
the [server build](../zipkin-server).

Please note all modules here require JRE 8+
Please note all modules here require JRE 11+

These libraries are also usable outside the server, for example in
custom collectors or storage pipelines. While compatibility guarantees
Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/activemq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin-collector-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector-activemq</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin-collector-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions zipkin-collector/kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
<parent>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin-collector-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector-kafka</artifactId>
<name>Collector: Kafka 0.10+</name>

<properties>
<main.basedir>${project.basedir}/../..</main.basedir>
<kafka.version>3.6.0</kafka.version>
<kafka.version>3.6.1</kafka.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin</groupId>
<artifactId>zipkin-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<groupId>io.zipkin.zipkin2</groupId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/rabbitmq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin-collector-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector-rabbitmq</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/scribe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin-collector-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector-scribe</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions zipkin-junit5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin</groupId>
<artifactId>zipkin-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<groupId>io.zipkin.zipkin2</groupId>
Expand All @@ -32,7 +32,7 @@
<main.basedir>${project.basedir}/..</main.basedir>

<!-- temporarily control okio version until okhttp5 is releasing again -->
<okio.version>3.6.0</okio.version>
<okio.version>3.7.0</okio.version>
</properties>

<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-lens/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin</groupId>
<artifactId>zipkin-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-lens</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-server/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# zipkin-server
Zipkin Server is a Java 1.8+ service, packaged as an executable jar.
Zipkin Server is a Java 11+ service, packaged as an executable jar.

Span storage and collectors are [configurable](#configuration). By default, storage is in-memory,
the HTTP collector (POST /api/v2/spans endpoint) is enabled, and the server listens on port 9411.
Expand Down
6 changes: 3 additions & 3 deletions zipkin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin</groupId>
<artifactId>zipkin-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-server</artifactId>
Expand All @@ -30,9 +30,9 @@
<main.basedir>${project.basedir}/..</main.basedir>

<!-- Sometimes we need to override Armeria's Brave version -->
<brave.version>5.16.0</brave.version>
<brave.version>5.17.0</brave.version>
<!-- Version overrides to avoid CVEs due to out-of-date Spring deps -->
<log4j2.version>2.22.0</log4j2.version>
<log4j2.version>2.22.1</log4j2.version>
<snakeyaml.version>2.2</snakeyaml.version>
<proto.generatedSourceDirectory>${project.build.directory}/generated-test-sources/wire</proto.generatedSourceDirectory>
</properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2020 The OpenZipkin Authors
* Copyright 2015-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 Down Expand Up @@ -177,7 +177,7 @@ ScheduledExecutorService dynamicCredentialsScheduledExecutorService(

@Bean @Qualifier(QUALIFIER) @ConditionalOnSelfTracing
Consumer<ClientOptionsBuilder> esTracing(Optional<HttpTracing> maybeHttpTracing) {
if (!maybeHttpTracing.isPresent()) {
if (maybeHttpTracing.isEmpty()) {
// TODO: is there a special cased empty consumer we can use here? I suspect debug is cluttered
// Alternatively, check why we would ever get here if ConditionalOnSelfTracing matches
return client -> {
Expand Down
2 changes: 1 addition & 1 deletion zipkin-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Modules here implement popular storage options available by default in
the [server build](../zipkin-server).

Please note all modules here require JRE 8+ eventhough `InMemoryStorage`
Please note all modules here require JRE 11+ even if `InMemoryStorage`
will run on JRE 6+.

These libraries are also usable outside the server, for example in
Expand Down
2 changes: 1 addition & 1 deletion zipkin-storage/cassandra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin-storage-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-storage-cassandra</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2020 The OpenZipkin Authors
* Copyright 2015-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 Down Expand Up @@ -107,7 +107,7 @@ static Version ensureVersion(com.datastax.oss.driver.api.core.metadata.Metadata

static KeyspaceMetadata ensureExists(String keyspace, boolean searchEnabled, CqlSession session) {
KeyspaceMetadata result = session.getMetadata().getKeyspace(keyspace).orElse(null);
if (result == null || !result.getTable(Schema.TABLE_SPAN).isPresent()) {
if (result == null || result.getTable(Schema.TABLE_SPAN).isEmpty()) {
LOG.info("Installing schema {} for keyspace {}", SCHEMA_RESOURCE, keyspace);
applyCqlFile(keyspace, session, SCHEMA_RESOURCE);
if (searchEnabled) {
Expand Down
2 changes: 1 addition & 1 deletion zipkin-storage/elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin-storage-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-storage-elasticsearch</artifactId>
Expand Down
7 changes: 3 additions & 4 deletions zipkin-storage/mysql-v1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin-storage-parent</artifactId>
<version>2.25.3-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-storage-mysql-v1</artifactId>
Expand All @@ -29,9 +29,8 @@
<properties>
<main.basedir>${project.basedir}/../..</main.basedir>

<!-- TODO: upgrade when we make floor JDK 11 or 17
3.16 is the last to compile with JDK <17; 3.14 last for Java 8 -->
<jooq.version>3.14.16</jooq.version>
<!-- 3.16 is the last to compile with JDK 11 -->
<jooq.version>3.16.23</jooq.version>

<!-- jOOQ doesn't add the Generated annotation, so we have to explicitly disable rules -->
<errorprone.args>-Xep:InconsistentCapitalization:OFF</errorprone.args>
Expand Down
Loading

0 comments on commit 77869db

Please sign in to comment.