Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/java-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ jobs:

strategy:
matrix:
java-version: [8, 11, 17, 21]
include:
- { java-version: 8, distribution: temurin }
- { java-version: 11, distribution: temurin }
- { java-version: 17, distribution: temurin }
- { java-version: 21, distribution: temurin }
# Adoptium has not published Temurin 27 yet, so the 27 legs use Zulu
- { java-version: 27, distribution: zulu }

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Java
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java-version }}

- name: Build and test SDK
Expand All @@ -41,15 +47,18 @@ jobs:

strategy:
matrix:
java-version: [17, 21]
include:
- { java-version: 17, distribution: temurin }
- { java-version: 21, distribution: temurin }
- { java-version: 27, distribution: zulu }

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Java
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java-version }}

- name: Inject dummy example config
Expand Down
51 changes: 34 additions & 17 deletions duo-universal-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
</scm>

<profiles>
<profile>
<!-- 4.11.0 is the last Mockito release that runs on Java 8 -->
<id>jdk8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<mockito.version>4.11.0</mockito.version>
</properties>
</profile>
<profile>
<id>release</id>
<build>
Expand Down Expand Up @@ -109,6 +119,13 @@
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>2.11.0</version>
<exclusions>
<!-- jackson-databind declares byte-buddy but never references it -->
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
Expand All @@ -124,13 +141,22 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.11.2</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<!-- Test only: Mockito mocks with byte-buddy and self-attaches with
byte-buddy-agent, so the two are pinned in lockstep. -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.15.4</version>
<version>1.17.7</version>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a pre-existing issue (not related to your PR, but we might want to fix since we're touching this area). byte-buddy is only needed for tests, but is currently configured to be a default dependency, so it's part of the production builds as well.

We can add this to scope it to only tests:

<scope>test</scope>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scoping it only to tests using <scope>test</scope> lets jackson-databind's own byte-buddy 1.14.9 back in at compile scope. I have also excluded it from converter-jackson

<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>1.17.7</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand All @@ -144,7 +170,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<version>3.8.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
Expand All @@ -155,7 +181,7 @@
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
<goal>single</goal>
</goals>
</execution>
</executions>
Expand Down Expand Up @@ -184,19 +210,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0-M1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.2.0-M1</version>
</dependency>
</dependencies>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.cyclonedx</groupId>
Expand All @@ -220,5 +234,8 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- Mockito 5 is needed to mock on JDK 22 and newer. It is compiled for Java 11,
so the jdk8 profile drops back to the 4.x line when building on a Java 8 JDK. -->
<mockito.version>5.23.0</mockito.version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import java.net.URL;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.verify;

class ClientTest {
Expand Down
Loading