## Issue
Fixes#1909, Fixes#1899, Closes#1652
This pull request includes several updates to the GitHub Actions
workflows and Maven configuration files to modernize the Java version
and improve the build process. The most important changes include
upgrading the Java version, modifying the Maven build commands, and
updating dependencies.
## Change
- ⬆️ Min JDK version has been upgraded to 17
- 🗿 Hardening: run `mvn process-test-classes javadocs:aggregate` on
**ALL** modules to verify that code compiles before running integraiton
tests
- 💄 Reformat maven commands to multiline to fit on a screen
- Rename GoogleAiGeminiTokenizerTest to GoogleAiGeminiTokenizerIT
- Upgrade graalvm and Oracle image
- Run tests on every build, run integraiton tests only on
langchain4j/langchain4j repo
----
This pull request includes several updates to the GitHub workflows and
various project files to modernize the build environment and improve
testing processes. The most important changes include updating the Java
Development Kit (JDK) versions, modifying Maven commands for better
readability and functionality, and renaming test classes for
consistency.
### Updates to GitHub Workflows:
* **JDK Version Updates:**
*
[`.github/workflows/javadoc.yaml`](diffhunk://#diff-40d3687e6b489280a4b84d8a8ee6ceaee3d7ca3a8e161df603d1046daded3db3L30-R39):
Updated from JDK 8 to JDK 17 and changed the distribution to 'temurin'.
*
[`.github/workflows/main.yaml`](diffhunk://#diff-71cabc4177e41ea8f15a89eb65398fa8187739f68a2762706d84885cd8b2ddc3L31-R36):
Removed JDK 8 and 11, now only using JDK 17 and 21.
[[1]](diffhunk://#diff-71cabc4177e41ea8f15a89eb65398fa8187739f68a2762706d84885cd8b2ddc3L31-R36)
[[2]](diffhunk://#diff-71cabc4177e41ea8f15a89eb65398fa8187739f68a2762706d84885cd8b2ddc3L59-R68)
*
[`.github/workflows/nightly.yaml`](diffhunk://#diff-e79198339eb3fcc6974b6912e52526068eab3b7952ed67d03276479a235eb58eL13-L18):
Removed JDK 8 and 11, now only using JDK 17 and 21.
[[1]](diffhunk://#diff-e79198339eb3fcc6974b6912e52526068eab3b7952ed67d03276479a235eb58eL13-L18)
[[2]](diffhunk://#diff-e79198339eb3fcc6974b6912e52526068eab3b7952ed67d03276479a235eb58eL43-R46)
* **Maven Command Enhancements:**
*
[`.github/workflows/receive-pr.yml`](diffhunk://#diff-3f8fc2f08505435fdc4f66740e23234e3fee099725c4d72b02a67a0fc5db4c41L45-R47):
Reformatted Maven command for better readability.
*
[`.github/workflows/release.yaml`](diffhunk://#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL38-R44):
Reformatted Maven command for better readability and maintainability.
*
[`.github/workflows/release_core_and_parent.yaml`](diffhunk://#diff-29983aaefd1016684ce940117feefedb37edefca433dde927389805f65cdfee6L27-R31):
Reformatted Maven command for better readability.
*
[`.github/workflows/snapshot_release.yaml`](diffhunk://#diff-cf84df4f6da634dce2ec7dc5dfc37ddc1f47181a6dd4f2e1d81df7537356dcd8L34-R38):
Reformatted Maven command for better readability.
*
[`.github/workflows/snapshot_release_core_and_parent.yaml`](diffhunk://#diff-178e48d6db6047dafaad65fe4eb44b9bdbe8a90f03397c2c653de9fa07e830dfL34-R40):
Reformatted Maven command for better readability.
### Project File Updates:
* **Dependency and Property Updates:**
*
[`code-execution-engines/langchain4j-code-execution-engine-graalvm-polyglot/pom.xml`](diffhunk://#diff-336b440bd3a43cdb2df4f9c6ee2a0cb257703526e8700f607cc67ec7ec73f0eaL19-R20):
Updated GraalVM version from 23.1.1 to 24.1.0.
*
[`langchain4j-parent/pom.xml`](diffhunk://#diff-db1dfc1ccffac6c8f8ae2414e6aad535940aaf08a488d30941157dc53ec573b0L17-R18):
Updated Maven compiler plugin version to 3.13.0 and removed Java 11+
profile.
[[1]](diffhunk://#diff-db1dfc1ccffac6c8f8ae2414e6aad535940aaf08a488d30941157dc53ec573b0L17-R18)
[[2]](diffhunk://#diff-db1dfc1ccffac6c8f8ae2414e6aad535940aaf08a488d30941157dc53ec573b0L458-R458)
[[3]](diffhunk://#diff-db1dfc1ccffac6c8f8ae2414e6aad535940aaf08a488d30941157dc53ec573b0L616-L624)
* **Test Class Renaming:**
*
[`langchain4j-google-ai-gemini/src/test/java/dev/langchain4j/model/googleai/GoogleAiGeminiTokenizerIT.java`](diffhunk://#diff-76accbd5060e23e5e16220546f59fa5074b91b36c2d42ece8109fa800c9a2f3dL14-R14):
Renamed from `GoogleAiGeminiTokenizerTest.java` to follow integration
test naming conventions.
* **Miscellaneous Fixes:**
*
[`langchain4j-oracle/src/test/java/dev/langchain4j/store/embedding/oracle/CommonTestOperations.java`](diffhunk://#diff-4a9654970655bfc6505ad1b1d334df5751c823922bdca974630c3641e29cf951L24):
Added a constant for the Oracle image name and updated container startup
and connect timeouts.
[[1]](diffhunk://#diff-4a9654970655bfc6505ad1b1d334df5751c823922bdca974630c3641e29cf951L24)
[[2]](diffhunk://#diff-4a9654970655bfc6505ad1b1d334df5751c823922bdca974630c3641e29cf951R63-R64)
[[3]](diffhunk://#diff-4a9654970655bfc6505ad1b1d334df5751c823922bdca974630c3641e29cf951L72-R75)
*
[`langchain4j-qdrant/src/test/java/dev/langchain4j/store/embedding/qdrant/QdrantFilterConverterTest.java`](diffhunk://#diff-2006ea9aece1dcbcf4d519a514526e8314ecebf5575d9197fc5385c99e2c3119L68-R68):
Corrected assertions for better readability.
[[1]](diffhunk://#diff-2006ea9aece1dcbcf4d519a514526e8314ecebf5575d9197fc5385c99e2c3119L68-R68)
[[2]](diffhunk://#diff-2006ea9aece1dcbcf4d519a514526e8314ecebf5575d9197fc5385c99e2c3119L78-R78)
[[3]](diffhunk://#diff-2006ea9aece1dcbcf4d519a514526e8314ecebf5575d9197fc5385c99e2c3119L88-R88)
[[4]](diffhunk://#diff-2006ea9aece1dcbcf4d519a514526e8314ecebf5575d9197fc5385c99e2c3119L98-R98)
----
## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
## Issue
Closes#1691
## Change
Define a Json class in Judge0 which use Jackson and migrate all usages
in Judge0 package to it.
Generate getter and setter for Beans in Judge0 package to adapt Jackson.
## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core]
## Issue
#1506
## Change
Resolved version conflict:
```
[ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message:
[ERROR] Failed while enforcing releasability.
[ERROR]
[ERROR] Dependency convergence error for org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10 paths to dependency are:
[ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT
[ERROR] +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile
[ERROR] +-com.squareup.okio:okio:jar:3.6.0:compile
[ERROR] +-com.squareup.okio:okio-jvm:jar:3.6.0:compile
[ERROR] +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10:compile
[ERROR] and
[ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT
[ERROR] +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile
[ERROR] +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.8.21:compile
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :langchain4j-ollama
```
... caused by 'okhttp' dependency and enabled Maven enforcer plugin in
the following modules:
- LangChain4j :: Integration :: Anthropic
- LangChain4j :: Integration :: ChatGLM
- LangChain4j :: Integration :: Chroma
- LangChain4j :: Integration :: CloudFlare Workers AI
- LangChain4j :: Integration :: Cohere
- LangChain4j :: Integration :: DashScope
- LangChain4j :: Integration :: Hugging Face
- LangChain4j :: Integration :: Jina
- LangChain4j :: Integration :: Judge0
- LangChain4j :: Integration :: MistralAI
- LangChain4j :: Integration :: Nomic
- LangChain4j :: Integration :: OVHcloud AI
- LangChain4j :: Integration :: Ollama
- LangChain4j :: Integration :: Qianfan
- LangChain4j :: Integration :: Vearch
- LangChain4j :: Integration :: Vespa
- LangChain4j :: Integration :: Zhipu AI
- LangChain4j :: Web Search Engine :: SearchApi
- LangChain4j :: Web Search Engine :: Tavily
## Note
Please note that [issue ](https://github.com/square/okhttp/issues/8288)
for this was already created in `httpok` repository but it will not be
fixed in 4.x. It's reportedly already tackled in version 5.x.
With that in mind I suggest we apply temporary changes proposed in this
PR. After upgrading to `httpok` 5.x we will be able to remove these.
## Tests
`mvn clean test` passed
## Issue
#1506
## Change
Enabled Maven Enforcer Plugin on modules without existing version
conflicts to ensure they remain conflict-free. The Maven Enforcer Plugin
will now cause the build to fail if new conflicts are introduced
guarding against these.
## Tests
`mvn clean test` passed
## Issue
Related to https://github.com/langchain4j/langchain4j/issues/1066
## Change
Move judge0 code execution engine package from `dev.langchain4j.code` to
`dev.langchain4j.code.judge0`
## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
## Issue
https://github.com/langchain4j/langchain4j/issues/1048
## Change
I extract these classes as new module
`langchain4j-code-execution-engine-judge0` :
- `Judge0JavaScriptEngine`
- `JavaScriptCodeFixer`
- `Judge0JavaScriptExecutionTool`
- `JavaScriptCodeFixerTest`
and I moved the `com.squareup.okhttp3:okhttp` dependency from the main
module to that new one.
## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [x] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
with such a setting, you can safely build only once the whole project
with JDK 17 or even 21 without fearing any wrong API being injected in
.class files