This is an automated email from the ASF dual-hosted git repository. ppalaga 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 16d09ea Replace quarkus.camel.native.resources.* with quarkus.native.resources.* fix #988 16d09ea is described below commit 16d09ea8b4fe77d3c2895e0be755e1c2d3efeef8 Author: Peter Palaga <ppal...@redhat.com> AuthorDate: Mon Jun 21 11:34:12 2021 +0200 Replace quarkus.camel.native.resources.* with quarkus.native.resources.* fix #988 --- docs/modules/ROOT/pages/migration-guide/2.0.0.adoc | 5 ++++ .../ROOT/pages/reference/extensions/core.adoc | 16 +++++++----- .../ROOT/pages/reference/extensions/flatpack.adoc | 14 ++++++---- .../reference/extensions/google-bigquery.adoc | 9 ++++--- .../ROOT/pages/reference/extensions/jing.adoc | 14 ++++++---- .../ROOT/pages/reference/extensions/jolt.adoc | 14 ++++++---- .../ROOT/pages/reference/extensions/jslt.adoc | 18 ++++++++----- .../pages/reference/extensions/json-validator.adoc | 14 ++++++---- .../ROOT/pages/reference/extensions/jsonata.adoc | 13 +++++----- .../ROOT/pages/reference/extensions/msv.adoc | 13 ++++++---- .../ROOT/pages/reference/extensions/mustache.adoc | 14 ++++++---- .../ROOT/pages/reference/extensions/saxon.adoc | 14 ++++++---- .../ROOT/pages/reference/extensions/velocity.adoc | 14 ++++++---- .../ROOT/pages/reference/extensions/xpath.adoc | 14 ++++++---- .../modules/ROOT/pages/user-guide/native-mode.adoc | 17 +++++++----- .../core/deployment/CamelNativeImageProcessor.java | 30 +++++----------------- .../core/runtime/src/main/doc/configuration.adoc | 12 +++++---- .../org/apache/camel/quarkus/core/CamelConfig.java | 18 +++---------- .../runtime/src/main/doc/configuration.adoc | 14 ++++++---- .../runtime/src/main/doc/usage.adoc | 9 ++++--- .../jing/runtime/src/main/doc/configuration.adoc | 14 ++++++---- .../jolt/runtime/src/main/doc/configuration.adoc | 14 ++++++---- .../jslt/runtime/src/main/doc/configuration.adoc | 18 ++++++++----- .../runtime/src/main/doc/configuration.adoc | 14 ++++++---- .../runtime/src/main/doc/configuration.adoc | 13 +++++----- .../msv/runtime/src/main/doc/configuration.adoc | 13 ++++++---- .../runtime/src/main/doc/configuration.adoc | 14 ++++++---- .../saxon/runtime/src/main/doc/configuration.adoc | 14 ++++++---- .../runtime/src/main/doc/configuration.adoc | 14 ++++++---- .../xpath/runtime/src/main/doc/configuration.adoc | 14 ++++++---- .../src/main/resources/application.properties | 2 +- .../core/src/main/resources/application.properties | 4 +-- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../component/geocoder/it/MockApiService.java | 2 ++ .../src/main/resources/application.properties | 5 ---- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../jing/src/main/resources/application.properties | 2 +- .../jolt/src/main/resources/application.properties | 2 +- .../jsch/src/main/resources/application.properties | 2 +- .../jslt/src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../msv/src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../nats/src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../soap/src/main/resources/application.properties | 2 +- .../stax/src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- 55 files changed, 276 insertions(+), 207 deletions(-) diff --git a/docs/modules/ROOT/pages/migration-guide/2.0.0.adoc b/docs/modules/ROOT/pages/migration-guide/2.0.0.adoc index 52585ef..a2819b6 100644 --- a/docs/modules/ROOT/pages/migration-guide/2.0.0.adoc +++ b/docs/modules/ROOT/pages/migration-guide/2.0.0.adoc @@ -19,3 +19,8 @@ The empty `camel-quarkus-main` artifact was removed completely in Camel Quarkus As long as your application depends on any other Camel Quarkus extension, it is enough to remove the `camel-quarkus-main` dependency. This is because all Camel Quarkus extensions transitively depend on `camel-quarkus-core` where the the original `camel-quarkus-main` functionality is hosted now. + +== `quarkus.camel.native.resources.*` replaced by `quarkus.native.resources.includes` + +The `quarkus.camel.native.resources.include-patterns` and `quarkus.camel.native.resources.exclude-patterns` configuration properties were removed in Camel Quarkus 2.0.0. +Please use `quarkus.native.resources.includes` and `quarkus.native.resources.excludes` instead respectively. diff --git a/docs/modules/ROOT/pages/reference/extensions/core.adoc b/docs/modules/ROOT/pages/reference/extensions/core.adoc index 50c5978..5ecead6 100644 --- a/docs/modules/ROOT/pages/reference/extensions/core.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/core.adoc @@ -74,21 +74,23 @@ simple("${body} is 'java.nio.ByteBuffer'") As such, the class `java.nio.ByteBuffer` needs to be link:https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection[registered for reflection]. ==== Using the simple language with classpath resources in native mode -Beyond standard usages, a trick is needed when using the simple language with classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. -For instance, the route below would load a simple script from a classpath resource named _mysimple.txt_: +If your route is supposed to load a Simple script from classpath, like in the following example + [source,java] ---- from("direct:start").transform().simple("resource:classpath:mysimple.txt"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +then you need to use Quarkus `quarkus.native.resources.includes` property to include the resource in the native executable +as demonstrated below: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.txt +quarkus.native.resources.includes = mysimple.txt ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. [width="100%",cols="80,5,15",options="header"] @@ -182,13 +184,13 @@ Used for inclusive filtering scanning of RouteBuilder classes. The exclusive fil |icon:lock[title=Fixed at build time] [[quarkus.camel.native.resources.exclude-patterns]]`link:#quarkus.camel.native.resources.exclude-patterns[quarkus.camel.native.resources.exclude-patterns]` -A comma separated list of Ant-path style patterns to match resources that should be excluded from the native executable. By default, resources not selected by quarkus itself are ignored. Then, inclusion of additional resources could be triggered with `includePatterns`. When the inclusion patterns is too large, eviction of previously selected resources could be triggered with `excludePatterns`. +Replaced by `quarkus.native.resources.excludes` in Camel Quarkus 2.0.0. Using this property throws an exception at build time. | `string` | |icon:lock[title=Fixed at build time] [[quarkus.camel.native.resources.include-patterns]]`link:#quarkus.camel.native.resources.include-patterns[quarkus.camel.native.resources.include-patterns]` -A comma separated list of Ant-path style patterns to match resources that should be included in the native executable. By default, resources not selected by quarkus itself are ignored. Then, inclusion of additional resources could be triggered with `includePatterns`. When the inclusion patterns is too large, eviction of previously selected resources could be triggered with `excludePatterns`. +Replaced by `quarkus.native.resources.includes` in Camel Quarkus 2.0.0. Using this property throws an exception at build time. | `string` | diff --git a/docs/modules/ROOT/pages/reference/extensions/flatpack.adoc b/docs/modules/ROOT/pages/reference/extensions/flatpack.adoc index 160b5f9..fa21d15 100644 --- a/docs/modules/ROOT/pages/reference/extensions/flatpack.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/flatpack.adoc @@ -41,19 +41,23 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ == Additional Camel Quarkus configuration -Beyond standard usages described above, a trick is needed when using flatpack mappings from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads Flatpack mappings from classpath. +To make it work also in native mode, you need to explicitly embed the mappings in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below loads the Flatpack mappings from a classpath resource named `mappings/simple.pzmap.xml`: -For instance, the route below would load the flatpack mapping from a classpath resource named _mappings/simple.pzmap.xml_: [source,java] ---- from("direct:start").to("flatpack:delim:mappings/simple.pzmap.xml"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other mappings stored in `.pzmap.xml` files under the `mappings` directory) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = mappings/*.pzmap.xml +quarkus.native.resources.includes = mappings/*.pzmap.xml ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/google-bigquery.adoc b/docs/modules/ROOT/pages/reference/extensions/google-bigquery.adoc index a590d6a..b26a6f9 100644 --- a/docs/modules/ROOT/pages/reference/extensions/google-bigquery.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/google-bigquery.adoc @@ -42,11 +42,12 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ == Usage -This extension leverages the Quarkiverse Google Cloud Services extension. The https://github.com/quarkiverse/quarkiverse-google-cloud-services[documentation] describes -how to configure authentication for Google cloud services. +This extension leverages the Quarkiverse Google Cloud Services extension. +The https://github.com/quarkiverse/quarkiverse-google-cloud-services[documentation] describes how to configure authentication for Google cloud services. For convenience, a `GoogleBigQueryConnectionFactory` for use by the `google-bigquery` & `google-bigquery-sql` component is automatically configured. -If you want to read SQL scripts from the classpath with `google-bigquery-sql` in native mode, then you will need to ensure that they are added to the native image via -the `quarkus.camel.native.resources.include-patterns` configuration property. +If you want to read SQL scripts from the classpath with `google-bigquery-sql` in native mode, +then you will need to ensure that they are added to the native image via the `quarkus.native.resources.includes` configuration property. +Please check https://quarkus.io/guides/building-native-image#quarkus-native-pkg-native-config_quarkus.native.resources.includes[Quarkus documentation] for more details. diff --git a/docs/modules/ROOT/pages/reference/extensions/jing.adoc b/docs/modules/ROOT/pages/reference/extensions/jing.adoc index fe87d67..760e77f 100644 --- a/docs/modules/ROOT/pages/reference/extensions/jing.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/jing.adoc @@ -40,19 +40,23 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ == Additional Camel Quarkus configuration -Beyond standard usages described above, a trick is needed when using jing schemas from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads schemas from classpath resources. +To make it work also in native mode, you need to explicitly embed the schema files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the Jing schema from a classpath resource named `schema.rng`: -For instance, the route below would load the jing schema from a classpath resource named _schema.rng_: [source,java] ---- from("direct:start").to("jing:schema.rng"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other schemas stored in `.rng` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.rng +quarkus.native.resources.includes = *.rng ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/jolt.adoc b/docs/modules/ROOT/pages/reference/extensions/jolt.adoc index 2c2329a..29c7361 100644 --- a/docs/modules/ROOT/pages/reference/extensions/jolt.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/jolt.adoc @@ -46,19 +46,23 @@ The `allowContextMapAll` option is not supported in native mode as it requires r == Additional Camel Quarkus configuration -Beyond standard usages described above, a trick is needed when using jolt specs from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads its specs from classpath resources. +To make it work also in native mode, you need to explicitly embed the spec files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the Jolt spec from a classpath resource named `defaultr.json`: -For instance, the route below would load the jolt spec from a classpath resource named _defaultr.json_: [source,java] ---- from("direct:start").to("jolt:defaultr.json"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other specs stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.json +quarkus.native.resources.includes = *.json ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/jslt.adoc b/docs/modules/ROOT/pages/reference/extensions/jslt.adoc index 400b3f6..97bc72f 100644 --- a/docs/modules/ROOT/pages/reference/extensions/jslt.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/jslt.adoc @@ -45,24 +45,30 @@ The `allowContextMapAll` option is not supported in native mode as it requires r == Additional Camel Quarkus configuration -=== Using JSLT templates from classpath resource in native mode -A trick is needed when using JSLT templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +=== Loading JSLT templates from classpath in native mode + +This component typically loads the templates from classpath. +To make it work also in native mode, you need to explicitly embed the templates files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the JSLT schema from a classpath resource named `transformation.json`: -For instance, the route below would load the JSLT schema from a classpath resource named _transformation.json_: [source,java] ---- from("direct:start").to("jslt:transformation.json"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other templates stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.json +quarkus.native.resources.includes = *.json ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. === Using JSLT functions in native mode + When using JSLT functions from camel-quarkus in native mode, the classes hosting the functions would need to be link:https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection[registered for reflection]. When registering the target function is not possible, one may end up writing a stub as below. ---- @RegisterForReflection diff --git a/docs/modules/ROOT/pages/reference/extensions/json-validator.adoc b/docs/modules/ROOT/pages/reference/extensions/json-validator.adoc index 1bd55a6..d7fd3d2 100644 --- a/docs/modules/ROOT/pages/reference/extensions/json-validator.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/json-validator.adoc @@ -46,19 +46,23 @@ The `allowContextMapAll` option is not supported in native mode as it requires r == Additional Camel Quarkus configuration -Beyond standard usages described above, a trick is needed when using json-validator templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads JSON schemas from classpath. +To make it work also in native mode, you need to explicitly embed the schema files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the schema from a classpath resource named `schema.json`: -For instance, the route below would load the json-validator template from a classpath resource named _schema.json_: [source,java] ---- from("direct:start").to("json-validator:schema.json"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other schemas stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = schema.json +quarkus.native.resources.includes = schema.json ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/jsonata.adoc b/docs/modules/ROOT/pages/reference/extensions/jsonata.adoc index 7353137..45573ef 100644 --- a/docs/modules/ROOT/pages/reference/extensions/jsonata.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/jsonata.adoc @@ -45,20 +45,21 @@ The `allowContextMapAll` option is not supported in native mode as it requires r == Additional Camel Quarkus configuration -=== Using specifications from classpath resource in native mode -A trick is needed when using specifications from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads JSONata specifications from classpath. +To make it work also in native mode, you need to explicitly embed the specification files in the native executable +by using the `quarkus.native.resources.includes` property. -For instance, the route below would load the specification from a classpath resource named _spec/expressions.spec_: [source,java] ---- from("direct:start").to("jsonata:spec/expressions.spec"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other specifications stored in `.spec` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = spec/*.spec +quarkus.native.resources.includes = spec/*.spec ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/msv.adoc b/docs/modules/ROOT/pages/reference/extensions/msv.adoc index 6e96ee6..7c6a8b6 100644 --- a/docs/modules/ROOT/pages/reference/extensions/msv.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/msv.adoc @@ -40,19 +40,22 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ == Additional Camel Quarkus configuration -Beyond standard usages described above, a trick is needed when using msv schemas from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads XML schemas from classpath. +To make it work also in native mode, you need to explicitly embed the schema files in the native executable +by using the `quarkus.native.resources.includes` property. -For instance, the route below would load the msv schema from a classpath resource named _schema.rng_: +For instance, the route below would load the schema from a classpath resource named `schema.rng`: [source,java] ---- from("direct:start").to("msv:schema.rng"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other schemas stored in `.rng` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.rng +quarkus.native.resources.includes = *.rng ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/mustache.adoc b/docs/modules/ROOT/pages/reference/extensions/mustache.adoc index ddccf00..863aed0 100644 --- a/docs/modules/ROOT/pages/reference/extensions/mustache.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/mustache.adoc @@ -46,19 +46,23 @@ The `allowContextMapAll` option is not supported in native mode as it requires r == Additional Camel Quarkus configuration -Beyond standard usages described above, a trick is needed when using mustache templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads Mustache templates from classpath. +To make it work also in native mode, you need to explicitly embed the templates in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the Mustache template from a classpath resource named `template/simple.mustache`: -For instance, the route below would load the mustache template from a classpath resource named _template/simple.mustache_: [source,java] ---- from("direct:start").to("mustache://template/simple.mustache"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other templates stored in `.mustache` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = template/*.mustache +quarkus.native.resources.includes = template/*.mustache ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/saxon.adoc b/docs/modules/ROOT/pages/reference/extensions/saxon.adoc index b772b8b..ad0de16 100644 --- a/docs/modules/ROOT/pages/reference/extensions/saxon.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/saxon.adoc @@ -41,20 +41,24 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ == Additional Camel Quarkus configuration -Beyond standard usages described above, a trick is needed when using the xquery language and component with classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component is able to load XQuery definitions from classpath. +To make it work also in native mode, you need to explicitly embed the queries in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the two routes below load an XQuery script from two classpath resources named `myxquery.txt` and `another-xquery.txt` respectively: -For instance, the 2 routes below would load a xquery script from 2 classpath resources respectively named _myxquery.txt_ and _another-xquery.txt_: [source,java] ---- from("direct:start").transform().xquery("resource:classpath:myxquery.txt", String.class); from("direct:start").to("xquery:another-xquery.txt"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include these (an possibly other queries stored in `.txt` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.txt +quarkus.native.resources.includes = *.txt ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/velocity.adoc b/docs/modules/ROOT/pages/reference/extensions/velocity.adoc index 7fcddaf..0ce3c95 100644 --- a/docs/modules/ROOT/pages/reference/extensions/velocity.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/velocity.adoc @@ -45,19 +45,23 @@ The `allowContextMapAll` option is not supported in native mode as it requires r == Additional Camel Quarkus configuration -Beyond standard usages described above, a trick is needed when using velocity templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads Velocity templates from classpath. +To make it work also in native mode, you need to explicitly embed the templates in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the Velocity template from a classpath resource named `template/simple.vm`: -For instance, the route below would load the velocity template from a classpath resource named _template/simple.vm_: [source,java] ---- from("direct:start").to("velocity://template/simple.vm"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other templates stored in `.vm` files in the `template` directory) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = template/*.vm +quarkus.native.resources.includes = template/*.vm ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/reference/extensions/xpath.adoc b/docs/modules/ROOT/pages/reference/extensions/xpath.adoc index 101594d..404da3e 100644 --- a/docs/modules/ROOT/pages/reference/extensions/xpath.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/xpath.adoc @@ -41,19 +41,23 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ == Additional Camel Quarkus configuration -Beyond standard usages, a trick is needed when using the xpath language with classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component is able to load xpath expressions from classpath resources. +To make it work also in native mode, you need to explicitly embed the expression files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load an XPath expression from a classpath resource named `myxpath.txt`: -For instance, the route below would load an xpath script from a classpath resource named _myxpath.txt_: [source,java] ---- from("direct:start").transform().xpath("resource:classpath:myxpath.txt"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other expressions stored in `.txt` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.txt +quarkus.native.resources.includes = *.txt ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/docs/modules/ROOT/pages/user-guide/native-mode.adoc b/docs/modules/ROOT/pages/user-guide/native-mode.adoc index 5911594..993b137 100644 --- a/docs/modules/ROOT/pages/user-guide/native-mode.adoc +++ b/docs/modules/ROOT/pages/user-guide/native-mode.adoc @@ -44,18 +44,23 @@ You can set those via Quarkus `quarkus.native.additional-build-args` property. [[embedding-resource-in-native-executable]] == Embedding resources in the native executable -Resources needed at runtime need to be explicitly embedded in the built native executable. In such situations, the `include-patterns` and `exclude-patterns` configurations could be set in `application.properties` as demonstrated below: +Resources accessed via `Class.getResource()`, `Class.getResourceAsStream()`, `ClassLoader.getResource()`, +`ClassLoader.getResourceAsStream()`, etc. at runtime need to be explicitly listed for including in the native executable. + +This can be done using Quarkus `quarkus.native.resources.includes` and `quarkus.native.resources.excludes` properties +in `application.properties` file as demonstrated below: [source,properties] ---- -quarkus.camel.native.resources.include-patterns = docs/*,images/* -quarkus.camel.native.resources.exclude-patterns = docs/ignored.adoc,images/ignored.png +quarkus.native.resources.includes = docs/*,images/* +quarkus.native.resources.excludes = docs/ignored.adoc,images/ignored.png ---- -In the example above, resources named _docs/included.adoc_ and _images/included.png_ would be embedded in the native executable while _docs/ignored.adoc_ and _images/ignored.png_ would not. +In the example above, resources named `docs/included.adoc` and `images/included.png` would be embedded in the native executable +while `docs/ignored.adoc` and `images/ignored.png` would not. -`include-patterns` and `exclude-patterns` are list of comma separated link:https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/AntPathMatcher.java[Ant-path style patterns]. -At the end of the day, resources matching `include-patterns` are marked for inclusion at the exception of resources matching `exclude-patterns`. +`resources.includes` and `resources.excludes` are both lists of comma separated Ant-path style glob patterns. +Please refer to https://quarkus.io/guides/building-native-image#quarkus-native-pkg-native-config_quarkus.native.resources.includes[Quarkus documentation] for more details. [[using-onexception-clause-in-native-mode]] == Using the onException clause in native mode diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelNativeImageProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelNativeImageProcessor.java index 8fe6cb4..548f6df 100644 --- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelNativeImageProcessor.java +++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelNativeImageProcessor.java @@ -217,31 +217,13 @@ public class CamelNativeImageProcessor { BuildProducer<NativeImageResourceBuildItem> resources) { final ResourcesConfig resourcesConfig = config.native_.resources; - if (!resourcesConfig.includePatterns.isPresent()) { - LOGGER.debug("Not scanning resources for native inclusion as include-patterns is not set"); - return; + if (resourcesConfig.includePatterns.isPresent()) { + throw new IllegalStateException( + "quarkus.camel.native.resources.include-patterns configuration property was removed in Camel Quarkus 2.0.0. Use quarkus.native.resources.includes instead."); } - - LOGGER.debug("Scanning resources for native inclusion from include-patterns {}", - resourcesConfig.includePatterns.get()); - - PathFilter pathFilter = new PathFilter.Builder() - .include(resourcesConfig.includePatterns) - .exclude(resourcesConfig.excludePatterns) - .build(); - - for (ApplicationArchive archive : archives.getAllApplicationArchives()) { - LOGGER.debug("Scanning resources for native inclusion from archive at {}", archive.getPaths()); - - for (Path rootPath : archive.getRootDirs()) { - CamelSupport.safeWalk(rootPath).filter(path -> Files.isRegularFile(path)) - .map(rootPath::relativize) - .filter(pathFilter.asPathPredicate()) - .forEach(filteredPath -> { - resources.produce(new NativeImageResourceBuildItem(filteredPath.toString())); - LOGGER.debug("Embedding resource in native executable: {}", filteredPath.toString()); - }); - } + if (resourcesConfig.excludePatterns.isPresent()) { + throw new IllegalStateException( + "quarkus.camel.native.resources.exclude-patterns configuration property was removed in Camel Quarkus 2.0.0. Use quarkus.native.resources.excludes instead."); } } diff --git a/extensions-core/core/runtime/src/main/doc/configuration.adoc b/extensions-core/core/runtime/src/main/doc/configuration.adoc index c6d6ace..0b040fd 100644 --- a/extensions-core/core/runtime/src/main/doc/configuration.adoc +++ b/extensions-core/core/runtime/src/main/doc/configuration.adoc @@ -25,18 +25,20 @@ simple("${body} is 'java.nio.ByteBuffer'") As such, the class `java.nio.ByteBuffer` needs to be link:https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection[registered for reflection]. ==== Using the simple language with classpath resources in native mode -Beyond standard usages, a trick is needed when using the simple language with classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. -For instance, the route below would load a simple script from a classpath resource named _mysimple.txt_: +If your route is supposed to load a Simple script from classpath, like in the following example + [source,java] ---- from("direct:start").transform().simple("resource:classpath:mysimple.txt"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +then you need to use Quarkus `quarkus.native.resources.includes` property to include the resource in the native executable +as demonstrated below: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.txt +quarkus.native.resources.includes = mysimple.txt ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java index e856007..61dc03e 100644 --- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java +++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java @@ -212,25 +212,15 @@ public class CamelConfig { public static class ResourcesConfig { /** - * A comma separated list of Ant-path style patterns to match resources - * that should be <strong>excluded</strong> from the native executable. By default, - * resources not selected by quarkus itself are ignored. Then, inclusion - * of additional resources could be triggered with - * <code>includePatterns</code>. When the inclusion patterns is too - * large, eviction of previously selected resources could be triggered - * with <code>excludePatterns</code>. + * Replaced by {@code quarkus.native.resources.excludes} in Camel Quarkus 2.0.0. + * Using this property throws an exception at build time. */ @ConfigItem public Optional<List<String>> excludePatterns; /** - * A comma separated list of Ant-path style patterns to match resources - * that should be <strong>included</strong> in the native executable. By default, - * resources not selected by quarkus itself are ignored. Then, inclusion - * of additional resources could be triggered with - * <code>includePatterns</code>. When the inclusion patterns is too - * large, eviction of previously selected resources could be triggered - * with <code>excludePatterns</code>. + * Replaced by {@code quarkus.native.resources.includes} in Camel Quarkus 2.0.0. + * Using this property throws an exception at build time. */ @ConfigItem public Optional<List<String>> includePatterns; diff --git a/extensions/flatpack/runtime/src/main/doc/configuration.adoc b/extensions/flatpack/runtime/src/main/doc/configuration.adoc index 25ee401..00211f0 100644 --- a/extensions/flatpack/runtime/src/main/doc/configuration.adoc +++ b/extensions/flatpack/runtime/src/main/doc/configuration.adoc @@ -1,15 +1,19 @@ -Beyond standard usages described above, a trick is needed when using flatpack mappings from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads Flatpack mappings from classpath. +To make it work also in native mode, you need to explicitly embed the mappings in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below loads the Flatpack mappings from a classpath resource named `mappings/simple.pzmap.xml`: -For instance, the route below would load the flatpack mapping from a classpath resource named _mappings/simple.pzmap.xml_: [source,java] ---- from("direct:start").to("flatpack:delim:mappings/simple.pzmap.xml"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other mappings stored in `.pzmap.xml` files under the `mappings` directory) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = mappings/*.pzmap.xml +quarkus.native.resources.includes = mappings/*.pzmap.xml ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/extensions/google-bigquery/runtime/src/main/doc/usage.adoc b/extensions/google-bigquery/runtime/src/main/doc/usage.adoc index 7bced01..db37bbc 100644 --- a/extensions/google-bigquery/runtime/src/main/doc/usage.adoc +++ b/extensions/google-bigquery/runtime/src/main/doc/usage.adoc @@ -1,7 +1,8 @@ -This extension leverages the Quarkiverse Google Cloud Services extension. The https://github.com/quarkiverse/quarkiverse-google-cloud-services[documentation] describes -how to configure authentication for Google cloud services. +This extension leverages the Quarkiverse Google Cloud Services extension. +The https://github.com/quarkiverse/quarkiverse-google-cloud-services[documentation] describes how to configure authentication for Google cloud services. For convenience, a `GoogleBigQueryConnectionFactory` for use by the `google-bigquery` & `google-bigquery-sql` component is automatically configured. -If you want to read SQL scripts from the classpath with `google-bigquery-sql` in native mode, then you will need to ensure that they are added to the native image via -the `quarkus.camel.native.resources.include-patterns` configuration property. +If you want to read SQL scripts from the classpath with `google-bigquery-sql` in native mode, +then you will need to ensure that they are added to the native image via the `quarkus.native.resources.includes` configuration property. +Please check https://quarkus.io/guides/building-native-image#quarkus-native-pkg-native-config_quarkus.native.resources.includes[Quarkus documentation] for more details. diff --git a/extensions/jing/runtime/src/main/doc/configuration.adoc b/extensions/jing/runtime/src/main/doc/configuration.adoc index 27fcc01..e04f7e5 100644 --- a/extensions/jing/runtime/src/main/doc/configuration.adoc +++ b/extensions/jing/runtime/src/main/doc/configuration.adoc @@ -1,15 +1,19 @@ -Beyond standard usages described above, a trick is needed when using jing schemas from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads schemas from classpath resources. +To make it work also in native mode, you need to explicitly embed the schema files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the Jing schema from a classpath resource named `schema.rng`: -For instance, the route below would load the jing schema from a classpath resource named _schema.rng_: [source,java] ---- from("direct:start").to("jing:schema.rng"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other schemas stored in `.rng` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.rng +quarkus.native.resources.includes = *.rng ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/extensions/jolt/runtime/src/main/doc/configuration.adoc b/extensions/jolt/runtime/src/main/doc/configuration.adoc index deb88d1..5cc0224 100644 --- a/extensions/jolt/runtime/src/main/doc/configuration.adoc +++ b/extensions/jolt/runtime/src/main/doc/configuration.adoc @@ -1,15 +1,19 @@ -Beyond standard usages described above, a trick is needed when using jolt specs from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads its specs from classpath resources. +To make it work also in native mode, you need to explicitly embed the spec files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the Jolt spec from a classpath resource named `defaultr.json`: -For instance, the route below would load the jolt spec from a classpath resource named _defaultr.json_: [source,java] ---- from("direct:start").to("jolt:defaultr.json"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other specs stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.json +quarkus.native.resources.includes = *.json ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/extensions/jslt/runtime/src/main/doc/configuration.adoc b/extensions/jslt/runtime/src/main/doc/configuration.adoc index 431d42c..a02cca9 100644 --- a/extensions/jslt/runtime/src/main/doc/configuration.adoc +++ b/extensions/jslt/runtime/src/main/doc/configuration.adoc @@ -1,21 +1,27 @@ -=== Using JSLT templates from classpath resource in native mode -A trick is needed when using JSLT templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +=== Loading JSLT templates from classpath in native mode + +This component typically loads the templates from classpath. +To make it work also in native mode, you need to explicitly embed the templates files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the JSLT schema from a classpath resource named `transformation.json`: -For instance, the route below would load the JSLT schema from a classpath resource named _transformation.json_: [source,java] ---- from("direct:start").to("jslt:transformation.json"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other templates stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.json +quarkus.native.resources.includes = *.json ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. === Using JSLT functions in native mode + When using JSLT functions from camel-quarkus in native mode, the classes hosting the functions would need to be link:https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection[registered for reflection]. When registering the target function is not possible, one may end up writing a stub as below. ---- @RegisterForReflection diff --git a/extensions/json-validator/runtime/src/main/doc/configuration.adoc b/extensions/json-validator/runtime/src/main/doc/configuration.adoc index b3c47bd..56cedc6 100644 --- a/extensions/json-validator/runtime/src/main/doc/configuration.adoc +++ b/extensions/json-validator/runtime/src/main/doc/configuration.adoc @@ -1,15 +1,19 @@ -Beyond standard usages described above, a trick is needed when using json-validator templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads JSON schemas from classpath. +To make it work also in native mode, you need to explicitly embed the schema files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the schema from a classpath resource named `schema.json`: -For instance, the route below would load the json-validator template from a classpath resource named _schema.json_: [source,java] ---- from("direct:start").to("json-validator:schema.json"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other schemas stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = schema.json +quarkus.native.resources.includes = schema.json ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/extensions/jsonata/runtime/src/main/doc/configuration.adoc b/extensions/jsonata/runtime/src/main/doc/configuration.adoc index 9487bc5..b519dd9 100644 --- a/extensions/jsonata/runtime/src/main/doc/configuration.adoc +++ b/extensions/jsonata/runtime/src/main/doc/configuration.adoc @@ -1,16 +1,17 @@ -=== Using specifications from classpath resource in native mode -A trick is needed when using specifications from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads JSONata specifications from classpath. +To make it work also in native mode, you need to explicitly embed the specification files in the native executable +by using the `quarkus.native.resources.includes` property. -For instance, the route below would load the specification from a classpath resource named _spec/expressions.spec_: [source,java] ---- from("direct:start").to("jsonata:spec/expressions.spec"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other specifications stored in `.spec` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = spec/*.spec +quarkus.native.resources.includes = spec/*.spec ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/extensions/msv/runtime/src/main/doc/configuration.adoc b/extensions/msv/runtime/src/main/doc/configuration.adoc index 379aaf5..994acd1 100644 --- a/extensions/msv/runtime/src/main/doc/configuration.adoc +++ b/extensions/msv/runtime/src/main/doc/configuration.adoc @@ -1,15 +1,18 @@ -Beyond standard usages described above, a trick is needed when using msv schemas from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads XML schemas from classpath. +To make it work also in native mode, you need to explicitly embed the schema files in the native executable +by using the `quarkus.native.resources.includes` property. -For instance, the route below would load the msv schema from a classpath resource named _schema.rng_: +For instance, the route below would load the schema from a classpath resource named `schema.rng`: [source,java] ---- from("direct:start").to("msv:schema.rng"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other schemas stored in `.rng` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.rng +quarkus.native.resources.includes = *.rng ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/extensions/mustache/runtime/src/main/doc/configuration.adoc b/extensions/mustache/runtime/src/main/doc/configuration.adoc index 643a9d0..fda8296 100644 --- a/extensions/mustache/runtime/src/main/doc/configuration.adoc +++ b/extensions/mustache/runtime/src/main/doc/configuration.adoc @@ -1,15 +1,19 @@ -Beyond standard usages described above, a trick is needed when using mustache templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads Mustache templates from classpath. +To make it work also in native mode, you need to explicitly embed the templates in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the Mustache template from a classpath resource named `template/simple.mustache`: -For instance, the route below would load the mustache template from a classpath resource named _template/simple.mustache_: [source,java] ---- from("direct:start").to("mustache://template/simple.mustache"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other templates stored in `.mustache` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = template/*.mustache +quarkus.native.resources.includes = template/*.mustache ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/extensions/saxon/runtime/src/main/doc/configuration.adoc b/extensions/saxon/runtime/src/main/doc/configuration.adoc index 0e22c61..54f2bd3 100644 --- a/extensions/saxon/runtime/src/main/doc/configuration.adoc +++ b/extensions/saxon/runtime/src/main/doc/configuration.adoc @@ -1,16 +1,20 @@ -Beyond standard usages described above, a trick is needed when using the xquery language and component with classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component is able to load XQuery definitions from classpath. +To make it work also in native mode, you need to explicitly embed the queries in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the two routes below load an XQuery script from two classpath resources named `myxquery.txt` and `another-xquery.txt` respectively: -For instance, the 2 routes below would load a xquery script from 2 classpath resources respectively named _myxquery.txt_ and _another-xquery.txt_: [source,java] ---- from("direct:start").transform().xquery("resource:classpath:myxquery.txt", String.class); from("direct:start").to("xquery:another-xquery.txt"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include these (an possibly other queries stored in `.txt` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.txt +quarkus.native.resources.includes = *.txt ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/extensions/velocity/runtime/src/main/doc/configuration.adoc b/extensions/velocity/runtime/src/main/doc/configuration.adoc index fb06ad0..b04f96c 100644 --- a/extensions/velocity/runtime/src/main/doc/configuration.adoc +++ b/extensions/velocity/runtime/src/main/doc/configuration.adoc @@ -1,15 +1,19 @@ -Beyond standard usages described above, a trick is needed when using velocity templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component typically loads Velocity templates from classpath. +To make it work also in native mode, you need to explicitly embed the templates in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load the Velocity template from a classpath resource named `template/simple.vm`: -For instance, the route below would load the velocity template from a classpath resource named _template/simple.vm_: [source,java] ---- from("direct:start").to("velocity://template/simple.vm"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other templates stored in `.vm` files in the `template` directory) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = template/*.vm +quarkus.native.resources.includes = template/*.vm ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. diff --git a/extensions/xpath/runtime/src/main/doc/configuration.adoc b/extensions/xpath/runtime/src/main/doc/configuration.adoc index 2d65305..17295b4 100644 --- a/extensions/xpath/runtime/src/main/doc/configuration.adoc +++ b/extensions/xpath/runtime/src/main/doc/configuration.adoc @@ -1,15 +1,19 @@ -Beyond standard usages, a trick is needed when using the xpath language with classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option. +This component is able to load xpath expressions from classpath resources. +To make it work also in native mode, you need to explicitly embed the expression files in the native executable +by using the `quarkus.native.resources.includes` property. + +For instance, the route below would load an XPath expression from a classpath resource named `myxpath.txt`: -For instance, the route below would load an xpath script from a classpath resource named _myxpath.txt_: [source,java] ---- from("direct:start").transform().xpath("resource:classpath:myxpath.txt"); ---- -In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below : +To include this (an possibly other expressions stored in `.txt` files) in the native image, you would have to add something like the following to your `application.properties` file: + [source,properties] ---- -quarkus.camel.native.resources.include-patterns = *.txt +quarkus.native.resources.includes = *.txt ---- -More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file +More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable]. \ No newline at end of file diff --git a/integration-test-groups/foundation/core-languages/src/main/resources/application.properties b/integration-test-groups/foundation/core-languages/src/main/resources/application.properties index 405a01f..f733578 100644 --- a/integration-test-groups/foundation/core-languages/src/main/resources/application.properties +++ b/integration-test-groups/foundation/core-languages/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = mysimple.txt,include-pattern-folder/* +quarkus.native.resources.includes = mysimple.txt,include-pattern-folder/* diff --git a/integration-test-groups/foundation/core/src/main/resources/application.properties b/integration-test-groups/foundation/core/src/main/resources/application.properties index 7a303ba..819426a 100644 --- a/integration-test-groups/foundation/core/src/main/resources/application.properties +++ b/integration-test-groups/foundation/core/src/main/resources/application.properties @@ -27,5 +27,5 @@ quarkus.camel.native.reflection.exclude-patterns = org.apache.commons.lang3.tupl # Quarkus :: Camel # quarkus.camel.runtime-catalog.languages = false -quarkus.camel.native.resources.include-patterns = mysimple.txt,include-pattern-folder/* -quarkus.camel.native.resources.exclude-patterns = exclude-pattern-folder/*,include-pattern-folder/excluded.txt +quarkus.native.resources.includes = mysimple.txt,include-pattern-folder/* +quarkus.native.resources.excludes = exclude-pattern-folder/*,include-pattern-folder/excluded.txt diff --git a/integration-tests/crypto/src/main/resources/application.properties b/integration-tests/crypto/src/main/resources/application.properties index e7eb376..97c9422 100644 --- a/integration-tests/crypto/src/main/resources/application.properties +++ b/integration-tests/crypto/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns=*.jks,*.pgp +quarkus.native.resources.includes=*.jks,*.pgp diff --git a/integration-tests/flatpack/src/main/resources/application.properties b/integration-tests/flatpack/src/main/resources/application.properties index 4a85452..59a1298 100644 --- a/integration-tests/flatpack/src/main/resources/application.properties +++ b/integration-tests/flatpack/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = *.pzmap.xml +quarkus.native.resources.includes = *.pzmap.xml diff --git a/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/MockApiService.java b/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/MockApiService.java index d86a7a7..2cd89c1 100644 --- a/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/MockApiService.java +++ b/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/MockApiService.java @@ -21,8 +21,10 @@ import java.lang.reflect.Field; import javax.enterprise.context.ApplicationScoped; import com.google.maps.GeoApiContext; +import io.quarkus.runtime.annotations.RegisterForReflection; @ApplicationScoped +@RegisterForReflection(targets = GeoApiContext.Builder.class) public class MockApiService { public GeoApiContext createGeoApiContext(String baseUri, String apiKey) diff --git a/integration-tests/geocoder/src/main/resources/application.properties b/integration-tests/geocoder/src/main/resources/application.properties index d3bb1dc..03f2551 100644 --- a/integration-tests/geocoder/src/main/resources/application.properties +++ b/integration-tests/geocoder/src/main/resources/application.properties @@ -20,8 +20,3 @@ #### properties for Google maps services # add your API KEY to run the examples google.api.key=${GOOGLE_API_KEY:AIzaFakeKey} - -# this configuration is needed only to mock Google Maps API -quarkus.index-dependency.gmaps.group-id=com.google.maps -quarkus.index-dependency.gmaps.artifact-id=google-maps-services -quarkus.camel.native.reflection.include-patterns=com.google.maps.GeoApiContext$Builder \ No newline at end of file diff --git a/integration-tests/jackson-avro/src/main/resources/application.properties b/integration-tests/jackson-avro/src/main/resources/application.properties index 185ba99..4722d6a 100644 --- a/integration-tests/jackson-avro/src/main/resources/application.properties +++ b/integration-tests/jackson-avro/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns=*.avsc \ No newline at end of file +quarkus.native.resources.includes=*.avsc \ No newline at end of file diff --git a/integration-tests/jackson-protobuf/src/main/resources/application.properties b/integration-tests/jackson-protobuf/src/main/resources/application.properties index e865d22..d040ae8 100644 --- a/integration-tests/jackson-protobuf/src/main/resources/application.properties +++ b/integration-tests/jackson-protobuf/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns=*.proto \ No newline at end of file +quarkus.native.resources.includes=*.proto \ No newline at end of file diff --git a/integration-tests/jing/src/main/resources/application.properties b/integration-tests/jing/src/main/resources/application.properties index b7c2c94..2635059 100644 --- a/integration-tests/jing/src/main/resources/application.properties +++ b/integration-tests/jing/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns=*.rnc,*.rng \ No newline at end of file +quarkus.native.resources.includes=*.rnc,*.rng \ No newline at end of file diff --git a/integration-tests/jolt/src/main/resources/application.properties b/integration-tests/jolt/src/main/resources/application.properties index 572c04e..4618e04 100644 --- a/integration-tests/jolt/src/main/resources/application.properties +++ b/integration-tests/jolt/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns=*.json +quarkus.native.resources.includes=*.json diff --git a/integration-tests/jsch/src/main/resources/application.properties b/integration-tests/jsch/src/main/resources/application.properties index 9d10c55..fb7ac9c 100644 --- a/integration-tests/jsch/src/main/resources/application.properties +++ b/integration-tests/jsch/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = *.pgp +quarkus.native.resources.includes = *.pgp diff --git a/integration-tests/jslt/src/main/resources/application.properties b/integration-tests/jslt/src/main/resources/application.properties index 1a1ab31..c03db50 100644 --- a/integration-tests/jslt/src/main/resources/application.properties +++ b/integration-tests/jslt/src/main/resources/application.properties @@ -15,5 +15,5 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = demoPlayground/*.json,objectFilter/*.json,withVariables/*.json +quarkus.native.resources.includes = demoPlayground/*.json,objectFilter/*.json,withVariables/*.json quarkus.test.flat-class-path=true diff --git a/integration-tests/json-validator/src/main/resources/application.properties b/integration-tests/json-validator/src/main/resources/application.properties index f06f3c3..720af70 100644 --- a/integration-tests/json-validator/src/main/resources/application.properties +++ b/integration-tests/json-validator/src/main/resources/application.properties @@ -15,4 +15,4 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = schema.json \ No newline at end of file +quarkus.native.resources.includes = schema.json \ No newline at end of file diff --git a/integration-tests/jsonata/src/main/resources/application.properties b/integration-tests/jsonata/src/main/resources/application.properties index 9f4372b..ab1a04c 100644 --- a/integration-tests/jsonata/src/main/resources/application.properties +++ b/integration-tests/jsonata/src/main/resources/application.properties @@ -15,4 +15,4 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns=spec/*.spec +quarkus.native.resources.includes=spec/*.spec diff --git a/integration-tests/msv/src/main/resources/application.properties b/integration-tests/msv/src/main/resources/application.properties index 46bf0d0..e19aa22 100644 --- a/integration-tests/msv/src/main/resources/application.properties +++ b/integration-tests/msv/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns=*.rng \ No newline at end of file +quarkus.native.resources.includes=*.rng \ No newline at end of file diff --git a/integration-tests/mustache/src/main/resources/application.properties b/integration-tests/mustache/src/main/resources/application.properties index bc76fbb..aa1faac 100644 --- a/integration-tests/mustache/src/main/resources/application.properties +++ b/integration-tests/mustache/src/main/resources/application.properties @@ -15,4 +15,4 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = template/*.mustache \ No newline at end of file +quarkus.native.resources.includes = template/*.mustache \ No newline at end of file diff --git a/integration-tests/nats/src/main/resources/application.properties b/integration-tests/nats/src/main/resources/application.properties index b94b7c4..12875be 100644 --- a/integration-tests/nats/src/main/resources/application.properties +++ b/integration-tests/nats/src/main/resources/application.properties @@ -14,6 +14,6 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns=certs/*.jks +quarkus.native.resources.includes=certs/*.jks camel.nats.test.enable-tls=${ENABLE_TLS_TESTS:false} \ No newline at end of file diff --git a/integration-tests/sap-netweaver/src/main/resources/application.properties b/integration-tests/sap-netweaver/src/main/resources/application.properties index 88691e4..d324319 100644 --- a/integration-tests/sap-netweaver/src/main/resources/application.properties +++ b/integration-tests/sap-netweaver/src/main/resources/application.properties @@ -16,4 +16,4 @@ ## --------------------------------------------------------------------------- # Add test sources for native testing -quarkus.camel.native.resources.include-patterns=flight-data.json,flight-data.xml +quarkus.native.resources.includes=flight-data.json,flight-data.xml diff --git a/integration-tests/saxon/src/main/resources/application.properties b/integration-tests/saxon/src/main/resources/application.properties index f3e342d..e711b69 100644 --- a/integration-tests/saxon/src/main/resources/application.properties +++ b/integration-tests/saxon/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = *.txt,*.xquery +quarkus.native.resources.includes = *.txt,*.xquery diff --git a/integration-tests/shiro/src/main/resources/application.properties b/integration-tests/shiro/src/main/resources/application.properties index a2f7d33..b7d68fa 100644 --- a/integration-tests/shiro/src/main/resources/application.properties +++ b/integration-tests/shiro/src/main/resources/application.properties @@ -15,4 +15,4 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = config/* +quarkus.native.resources.includes = config/* diff --git a/integration-tests/soap/src/main/resources/application.properties b/integration-tests/soap/src/main/resources/application.properties index 972e7d7..8652776 100644 --- a/integration-tests/soap/src/main/resources/application.properties +++ b/integration-tests/soap/src/main/resources/application.properties @@ -15,4 +15,4 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = schema/*,wsdl/* +quarkus.native.resources.includes = schema/*,wsdl/* diff --git a/integration-tests/stax/src/main/resources/application.properties b/integration-tests/stax/src/main/resources/application.properties index 14b2478..682cc9b 100644 --- a/integration-tests/stax/src/main/resources/application.properties +++ b/integration-tests/stax/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = *.xml +quarkus.native.resources.includes = *.xml diff --git a/integration-tests/stringtemplate/src/main/resources/application.properties b/integration-tests/stringtemplate/src/main/resources/application.properties index ce60864..9de5c09 100644 --- a/integration-tests/stringtemplate/src/main/resources/application.properties +++ b/integration-tests/stringtemplate/src/main/resources/application.properties @@ -14,4 +14,4 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = template/*.tm \ No newline at end of file +quarkus.native.resources.includes = template/*.tm \ No newline at end of file diff --git a/integration-tests/velocity/src/main/resources/application.properties b/integration-tests/velocity/src/main/resources/application.properties index a079822..de63ee4 100644 --- a/integration-tests/velocity/src/main/resources/application.properties +++ b/integration-tests/velocity/src/main/resources/application.properties @@ -15,4 +15,4 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = template/* \ No newline at end of file +quarkus.native.resources.includes = template/* \ No newline at end of file diff --git a/integration-tests/xpath/src/main/resources/application.properties b/integration-tests/xpath/src/main/resources/application.properties index 0651d9e..290f045 100644 --- a/integration-tests/xpath/src/main/resources/application.properties +++ b/integration-tests/xpath/src/main/resources/application.properties @@ -14,7 +14,7 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --------------------------------------------------------------------------- -quarkus.camel.native.resources.include-patterns = *.txt +quarkus.native.resources.includes = *.txt foo = Camel bar = Kong \ No newline at end of file