Support Java 21 (#336)

This PR is to fix #335
This commit is contained in:
Julien Dubois 2023-12-12 19:16:41 +01:00 committed by GitHub
parent 8e4254fc20
commit 3c0943d38b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 27 deletions

View File

@ -1,39 +1,38 @@
name: Java CI name: Java CI
on: [pull_request] on:
push:
branches:
- main
pull_request:
branches:
- main
jobs: jobs:
build: java_build:
strategy:
matrix:
java_version: [8, 11, 17, 21]
include:
- java_version: '8'
included_modules: '-pl !langchain4j-graal,!langchain4j-opensearch'
- java_version: '11'
included_modules: '-pl !langchain4j-graal'
- java_version: '17'
included_modules: '-pl !langchain4j-graal'
- java_version: '21'
included_modules: ''
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
- name: Set up JDK 8
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: '8' java-version: ${{ matrix.java_version }}
distribution: 'temurin' distribution: 'temurin'
cache: 'maven' cache: 'maven'
- name: Build with JDK 8 (excluding modules requiring JDK 11 and 17) - name: Build with JDK ${{ matrix.java_version }}
run: mvn --batch-mode install -DskipITs -pl !langchain4j-opensearch,!langchain4j-graal run: mvn --batch-mode install -DskipITs ${{ matrix.included_modules }}
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Build modules requiring JDK 11
run: mvn --batch-mode install -DskipITs -pl langchain4j-opensearch
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Build modules requiring JDK 17
run: mvn --batch-mode install -DskipTests -DskipITs -pl langchain4j-graal
# For checking some compliance things (require a recent JDK due to plugins so in a separate step) # For checking some compliance things (require a recent JDK due to plugins so in a separate step)
compliance: compliance:

View File

@ -75,14 +75,14 @@
<dependency> <dependency>
<groupId>dev.langchain4j</groupId> <groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId> <artifactId>langchain4j</artifactId>
<version>${parent.version}</version> <version>${project.parent.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>dev.langchain4j</groupId> <groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId> <artifactId>langchain4j-open-ai</artifactId>
<version>${parent.version}</version> <version>${project.parent.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>

View File

@ -30,6 +30,7 @@
<gson.version>2.10.1</gson.version> <gson.version>2.10.1</gson.version>
<junit.version>5.10.0</junit.version> <junit.version>5.10.0</junit.version>
<testcontainers.version>1.19.2</testcontainers.version> <testcontainers.version>1.19.2</testcontainers.version>
<bytebuddy.version>1.14.10</bytebuddy.version>
<mockito.version>4.11.0</mockito.version> <mockito.version>4.11.0</mockito.version>
<assertj.version>3.24.2</assertj.version> <assertj.version>3.24.2</assertj.version>
<tinylog.version>2.6.2</tinylog.version> <tinylog.version>2.6.2</tinylog.version>
@ -198,6 +199,12 @@
<version>${mockito.version}</version> <version>${mockito.version}</version>
</dependency> </dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${bytebuddy.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId> <artifactId>assertj-core</artifactId>
@ -313,6 +320,15 @@
</dependencyManagement> </dependencyManagement>
<build> <build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.honton.chas</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>0.0.3</version>
</plugin>
</plugins>
</pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>