Skip to content

Commit

Permalink
Updates all test dependencies including CI and removes Retrolambda (#214
Browse files Browse the repository at this point in the history
)

This updates all aspects of the build including GitHub Actions versions, maven versions and test dependency versions. Most notably, this allows use of Java 11-17. Main versions are left for a different change.

To achieve this, we replace parts of the build that used RetroLambda to use maven profiles (similar to zipkin), as RetroLambda is no longer maintained. We also have to keep Java 11 in releases as later versions cannot compiler Java 1.6 bytecode anymore.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt authored Dec 11, 2023
1 parent caf798d commit f530b0d
Show file tree
Hide file tree
Showing 30 changed files with 841 additions and 554 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,22 @@ on:

jobs:
create_release:
runs-on: ubuntu-20.04 # newest available distribution, aka focal
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Prevent use of implicit GitHub Actions read-only token GITHUB_TOKEN. We don't deploy on
# the tag MAJOR.MINOR.PATCH event, but we still need to deploy the maven-release-plugin master commit.
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 1 # only need the base commit as license check isn't run
fetch-depth: 1 # only need the HEAD commit as license check isn't run
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu' # zulu as it supports a wide version range
java-version: '11' # earliest LTS and last that can compile the 1.6 release profile.
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ on:

jobs:
deploy:
runs-on: ubuntu-20.04 # newest available distribution, aka focal
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1 # only needed to get the sha label
# Prevent use of implicit GitHub Actions read-only token GITHUB_TOKEN.
# We push Javadocs to the gh-pages branch on commit.
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0 # allow build-bin/idl_to_gh_pages to get the full history
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu' # zulu as it supports a wide version range
java-version: '11' # earliest LTS and last that can compile the 1.6 release profile.
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
30 changes: 22 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,34 @@ on:

jobs:
test:
runs-on: ubuntu-20.04 # newest available distribution, aka focal
name: test (JDK ${{ matrix.java_version }})
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
if: "!contains(github.event.head_commit.message, 'maven-release-plugin')"
strategy:
fail-fast: false # don't fail fast as sometimes failures are operating system specific
matrix: # use latest available versions and be consistent on all workflows!
include:
- java_version: 11 # Last that can compile core to 1.6
maven_args: -Prelease -Dgpg.skip
- java_version: 21 # Most recent LTS
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # full git history for license check
fetch-depth: 0 # full git history for license check
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu' # zulu as it supports a wide version range
java-version: ${{ matrix.java_version }}
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
# We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
# That's ok because DOCKER_PARENT_IMAGE is always ghcr.io and local anyway.
key: ${{ runner.os }}-jdk-${{ matrix.java_version }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-jdk-${{ matrix.java_version }}-maven-
# Don't attempt to cache Docker. Sensitive information can be stolen
# via forks, and login session ends up in ~/.docker. This is ok because
# we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner.
- name: Test
run: build-bin/configure_test && build-bin/test
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
20 changes: 18 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
41 changes: 41 additions & 0 deletions activemq-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@

<main.basedir>${project.basedir}/..</main.basedir>
<activemq.version>5.16.0</activemq.version>

<!-- CI should run the "release" profile during tests to ensure no 1.8
features are in use. -->
<main.java.version>1.8</main.java.version>
<main.signature.artifact>java18</main.signature.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -60,4 +65,40 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>release</id>
<properties>
<!-- activemq is Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!-- The only LTS JDK we support that can compile 1.6 bytecode is 11.
https://www.oracle.com/java/technologies/javase/12-relnote-issues.html -->
<requireJavaVersion>
<version>[11,12)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
36 changes: 36 additions & 0 deletions amqp-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,40 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>release</id>
<properties>
<!-- amqp-client 4.x is Java 1.6 bytecode -->
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!-- The only LTS JDK we support that can compile 1.6 bytecode is 11.
https://www.oracle.com/java/technologies/javase/12-relnote-issues.html -->
<requireJavaVersion>
<version>[11,12)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
19 changes: 3 additions & 16 deletions benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<jmh.version>1.27</jmh.version>
<main.java.version>1.8</main.java.version>
<main.signature.artifact>java18</main.signature.artifact>
<jmh.version>1.37</jmh.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -125,7 +123,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand All @@ -136,20 +134,9 @@

<build>
<plugins>
<!-- disable retrolambda as we allow language level 1.8 benchmark classes -->
<plugin>
<groupId>net.orfjackal.retrolambda</groupId>
<artifactId>retrolambda-maven-plugin</artifactId>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>${maven-shade-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
8 changes: 3 additions & 5 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<!-- use the same value in ../pom.xml -->
<zipkin.version>2.23.2</zipkin.version>
<zipkin-proto3.version>1.0.0</zipkin-proto3.version>

<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
</properties>

<url>https://github.com/openzipkin/zipkin-reporter-java</url>
Expand Down Expand Up @@ -159,7 +157,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -170,12 +168,12 @@

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.1.1</version>
</plugin>

<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
36 changes: 36 additions & 0 deletions brave/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,40 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>release</id>
<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>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!-- The only LTS JDK we support that can compile 1.6 bytecode is 11.
https://www.oracle.com/java/technologies/javase/12-relnote-issues.html -->
<requireJavaVersion>
<version>[11,12)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading

0 comments on commit f530b0d

Please sign in to comment.