This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push: new ad1aa5cc3a Improve the documentation for better Quarkus LangChain4j version alignment #6288 (#6289) ad1aa5cc3a is described below commit ad1aa5cc3a5a7f8e5dcbaeba8a13662fdcbc52d4 Author: Alexandre Gallice <aldettin...@gmail.com> AuthorDate: Wed Jul 24 19:48:39 2024 +0200 Improve the documentation for better Quarkus LangChain4j version alignment #6288 (#6289) --- .../reference/extensions/langchain4j-chat.adoc | 23 ++++++++++++++++++++ .../extensions/langchain4j-embeddings.adoc | 23 ++++++++++++++++++++ .../quarkus/maven/UpdateExtensionDocPageMojo.java | 1 + .../doc-templates/extension-doc-page.adoc | 25 ++++++++++++++++++++++ 4 files changed, 72 insertions(+) diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j-chat.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j-chat.adoc index 855c43735a..24c1d9de29 100644 --- a/docs/modules/ROOT/pages/reference/extensions/langchain4j-chat.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j-chat.adoc @@ -43,3 +43,26 @@ Or add the coordinates to your existing project: ifeval::[{doc-show-user-guide-link} == true] Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications. endif::[] + +[id="extensions-langchain4j-chat-quarkus-langchain4j-bom"] +== Ensure Quarkus LangChain4j dependencies version alignment with the Bom + +In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below: +[source,xml] +---- +<dependencyManagement> + <dependencies> + <dependency> + <groupId>io.quarkiverse.langchain4j</groupId> + <artifactId>quarkus-langchain4j-bom</artifactId> + <version>${insert your version here}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + ... +</dependencyManagement> +---- + +Note that the import order is paramount when using maven `dependencyManagement`. +As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms. diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j-embeddings.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j-embeddings.adoc index e208ac8166..d5de73d3c5 100644 --- a/docs/modules/ROOT/pages/reference/extensions/langchain4j-embeddings.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j-embeddings.adoc @@ -39,3 +39,26 @@ Please refer to the above link for usage and configuration details. ifeval::[{doc-show-user-guide-link} == true] Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications. endif::[] + +[id="extensions-langchain4j-embeddings-quarkus-langchain4j-bom"] +== Ensure Quarkus LangChain4j dependencies version alignment with the Bom + +In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below: +[source,xml] +---- +<dependencyManagement> + <dependencies> + <dependency> + <groupId>io.quarkiverse.langchain4j</groupId> + <artifactId>quarkus-langchain4j-bom</artifactId> + <version>${insert your version here}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + ... +</dependencyManagement> +---- + +Note that the import order is paramount when using maven `dependencyManagement`. +As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms. diff --git a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java index 8218464e8e..6e72fe6ba1 100644 --- a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java +++ b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java @@ -167,6 +167,7 @@ public class UpdateExtensionDocPageMojo extends AbstractDocGeneratorMojo { ext.getQuarkusAwsClientBaseName(), ext.getQuarkusAwsClientFqClassName(), ext.getRuntimePomXmlPath())); + model.put("activatesQuarkusLangChain4jBom", ext.getRuntimeArtifactId().contains("langchain4j")); model.put("configOptions", listConfigOptions(basePath, multiModuleProjectDirectory.toPath())); model.put("humanReadableKind", new TemplateMethodModelEx() { @Override diff --git a/tooling/maven-plugin/src/main/resources/doc-templates/extension-doc-page.adoc b/tooling/maven-plugin/src/main/resources/doc-templates/extension-doc-page.adoc index c5bec2b457..f08a96017f 100644 --- a/tooling/maven-plugin/src/main/resources/doc-templates/extension-doc-page.adoc +++ b/tooling/maven-plugin/src/main/resources/doc-templates/extension-doc-page.adoc @@ -98,6 +98,31 @@ You will also need to enable serialization for the exception classes that you in @RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true) ---- [/#if] +[#if activatesQuarkusLangChain4jBom ] + +[id="extensions-[=artifactIdBase]-quarkus-langchain4j-bom"] +== Ensure Quarkus LangChain4j dependencies version alignment with the Bom + +In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below: +[source,xml] +---- +<dependencyManagement> + <dependencies> + <dependency> + <groupId>io.quarkiverse.langchain4j</groupId> + <artifactId>quarkus-langchain4j-bom</artifactId> + <version>${insert your version here}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + ... +</dependencyManagement> +---- + +Note that the import order is paramount when using maven `dependencyManagement`. +As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms. +[/#if] [#if configuration?? || quarkusAwsClient?? || configOptions?size != 0 ] [id="extensions-[=artifactIdBase]-additional-camel-quarkus-configuration"]