This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new 3f7522dec Ref #3023: Add native compilation with sources
3f7522dec is described below

commit 3f7522decd4bbd8d5f2604c5d27f484eb2ec9f70
Author: Nicolas Filotto <[email protected]>
AuthorDate: Mon Feb 13 20:17:00 2023 +0100

    Ref #3023: Add native compilation with sources
---
 .github/actions/e2e-install-native/action.yml      |   8 +-
 .github/actions/e2e-install-native/exec-tests.sh   |  19 +++-
 .github/actions/kamel-build-binary/build-binary.sh |   6 +-
 .../actions/kamel-config-cluster-kind/action.yml   |   3 +-
 .../actions/kamel-preflight-test/preflight-test.sh |   2 +-
 .github/actions/kamel-prepare-env/action.yml       |  20 +++-
 .github/workflows/native.yml                       | 118 +++++++++++++++++++++
 config/crd/bases/camel.apache.org_builds.yaml      |  61 +++++++++++
 .../crd/bases/camel.apache.org_camelcatalogs.yaml  |   5 +
 .../bases/camel.apache.org_integrationkits.yaml    |  57 ++++++++++
 docs/modules/ROOT/partials/apis/camel-k-crds.adoc  |  31 +++++-
 docs/modules/traits/pages/quarkus.adoc             |   8 +-
 .../native/files/{Java.java => Groovy.groovy}      |  15 +--
 e2e/namespace/native/files/Java.java               |  20 ++--
 .../native/files/{Java.java => JavaScript.js}      |  15 +--
 .../native/files/{Java.java => Kotlin.kts}         |  15 +--
 e2e/namespace/native/files/Xml.xml                 |  33 ++++++
 e2e/namespace/native/native_binding_test.go        |   9 +-
 e2e/namespace/native/native_test.go                |  35 ++++--
 e2e/namespace/native/native_with_sources_test.go   | 103 ++++++++++++++++++
 e2e/support/test_support.go                        |   4 +-
 helm/camel-k/crds/crd-build.yaml                   |  61 +++++++++++
 helm/camel-k/crds/crd-camel-catalog.yaml           |   5 +
 helm/camel-k/crds/crd-integration-kit.yaml         |  57 ++++++++++
 pkg/apis/camel/v1/build_types.go                   |   2 +
 pkg/apis/camel/v1/camelcatalog_types.go            |   2 +
 pkg/apis/camel/v1/common_types.go                  |   3 +
 pkg/apis/camel/v1/integrationkit_types.go          |   2 +
 pkg/apis/camel/v1/trait/quarkus.go                 |   8 +-
 pkg/apis/camel/v1/zz_generated.deepcopy.go         |  21 ++++
 pkg/builder/quarkus.go                             |  53 ++++++++-
 .../applyconfiguration/camel/v1/buildertask.go     |  14 +++
 .../applyconfiguration/camel/v1/camelloader.go     |  15 +++
 .../camel/v1/integrationkitspec.go                 |  14 +++
 pkg/resources/resources.go                         |  16 +--
 pkg/trait/camel.go                                 |   2 +-
 pkg/trait/camel_test.go                            |  79 ++++++++++++--
 pkg/trait/quarkus.go                               |  81 +++++++++++++-
 pkg/trait/quarkus_test.go                          |  90 ++++++++++++++++
 pkg/trait/trait_test.go                            | 104 ++++++++++++++++++
 pkg/trait/trait_types.go                           |  44 +++++---
 pkg/util/source/inspector.go                       |   6 ++
 resources/traits.yaml                              |   1 -
 script/Makefile                                    |   4 +
 44 files changed, 1155 insertions(+), 116 deletions(-)

diff --git a/.github/actions/e2e-install-native/action.yml 
b/.github/actions/e2e-install-native/action.yml
index 37b633462..70b4556f2 100644
--- a/.github/actions/e2e-install-native/action.yml
+++ b/.github/actions/e2e-install-native/action.yml
@@ -25,6 +25,10 @@ inputs:
   cluster-kube-config-data:
     description: 'Base16 encoded kube config - required for custom cluster 
type only'
     required: false
+  high-memory:
+    description: 'Indicates whether the high memory integration tests should 
be launched (default false)'
+    default: 'false'
+    required: false
 
 runs:
   using: "composite"
@@ -90,7 +94,7 @@ runs:
     name: List Tests Marked As Problematic
     uses: ./.github/actions/kamel-report-problematic
     with:
-      test-suite: namespace/install
+      test-suite: namespace/native
 
   - id: run-it
     name: Run IT
@@ -104,6 +108,8 @@ runs:
         -n "${{ steps.build-kamel.outputs.build-binary-local-image-name }}" \
         -s "${{steps.config-cluster.outputs.cluster-image-registry-insecure 
}}" \
         -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" 
\
+        -t "${{ inputs.high-memory }}" \
+        -q "${{ env.CAMEL_K_LOG_LEVEL }}" \
         -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}"
 
   - name: Cleanup
diff --git a/.github/actions/e2e-install-native/exec-tests.sh 
b/.github/actions/e2e-install-native/exec-tests.sh
index db67931c1..2d9192fd5 100755
--- a/.github/actions/e2e-install-native/exec-tests.sh
+++ b/.github/actions/e2e-install-native/exec-tests.sh
@@ -25,7 +25,7 @@
 
 set -e
 
-while getopts ":b:c:i:l:n:s:v:x:" opt; do
+while getopts ":b:c:i:l:n:q:s:t:v:x:" opt; do
   case "${opt}" in
     b)
       BUILD_CATALOG_SOURCE_NAME=${OPTARG}
@@ -42,9 +42,15 @@ while getopts ":b:c:i:l:n:s:v:x:" opt; do
     n)
       IMAGE_NAME=${OPTARG}
       ;;
+    q)
+      LOG_LEVEL=${OPTARG}
+      ;;
     s)
       REGISTRY_INSECURE=${OPTARG}
       ;;
+    t)
+      HIGH_MEMORY=${OPTARG}
+      ;;
     v)
       IMAGE_VERSION=${OPTARG}
       ;;
@@ -116,5 +122,14 @@ export CAMEL_K_TEST_IMAGE_NAME=${CUSTOM_IMAGE}
 export CAMEL_K_TEST_IMAGE_VERSION=${CUSTOM_VERSION}
 export CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE=${SAVE_FAILED_TEST_NS}
 
+export CAMEL_K_TEST_LOG_LEVEL="${LOG_LEVEL}"
+if [ "${LOG_LEVEL}" == "debug" ]; then
+  export CAMEL_K_TEST_MAVEN_CLI_OPTIONS="-X ${CAMEL_K_TEST_MAVEN_CLI_OPTIONS}"
+fi
+
 # Then run integration tests
-DO_TEST_PREBUILD=false make test-quarkus-native
+if [ "${HIGH_MEMORY}" == "true" ]; then
+  DO_TEST_PREBUILD=false make test-quarkus-native-high-memory
+else
+  DO_TEST_PREBUILD=false make test-quarkus-native
+fi
diff --git a/.github/actions/kamel-build-binary/build-binary.sh 
b/.github/actions/kamel-build-binary/build-binary.sh
index cbf64e352..435149301 100755
--- a/.github/actions/kamel-build-binary/build-binary.sh
+++ b/.github/actions/kamel-build-binary/build-binary.sh
@@ -97,7 +97,11 @@ fi
 
 echo "Moving kamel binary to be visible on PATH"
 
-${SUDO} mv ./kamel /usr/bin
+if [ "$RUNNER_OS" == "macOS" ]; then
+  ${SUDO} mv ./kamel /usr/local/bin
+else
+  ${SUDO} mv ./kamel /usr/bin
+fi
 echo "Kamel version installed: $(kamel version)"
 
 #
diff --git a/.github/actions/kamel-config-cluster-kind/action.yml 
b/.github/actions/kamel-config-cluster-kind/action.yml
index 0f81599a2..c1f7f4831 100644
--- a/.github/actions/kamel-config-cluster-kind/action.yml
+++ b/.github/actions/kamel-config-cluster-kind/action.yml
@@ -23,11 +23,12 @@ runs:
   steps:
     - id: install-cluster
       name: Install Cluster
-      uses: container-tools/kind-action@v1
+      uses: 
container-tools/kind-action@61f1afd4807b0dac84f3232ec99e45c63701d220
       if: ${{ env.CLUSTER_KIND_CONFIGURED != 'true' }}
       with:
         version: v0.14.0
         node_image: 
kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae
+        cpu: 3
 
     - id: info
       name: Info
diff --git a/.github/actions/kamel-preflight-test/preflight-test.sh 
b/.github/actions/kamel-preflight-test/preflight-test.sh
index f2779b9f8..9089e4ed3 100755
--- a/.github/actions/kamel-preflight-test/preflight-test.sh
+++ b/.github/actions/kamel-preflight-test/preflight-test.sh
@@ -38,7 +38,7 @@ waitForOperator() {
   #
   # Wait for the operator to be running
   #
-  local timeout=180
+  local timeout=360
   local i=1
   local command="kubectl get pods -n ${NAMESPACE} 2> /dev/null | grep camel-k 
| grep Running &> /dev/null"
 
diff --git a/.github/actions/kamel-prepare-env/action.yml 
b/.github/actions/kamel-prepare-env/action.yml
index d23345a04..271d2074e 100644
--- a/.github/actions/kamel-prepare-env/action.yml
+++ b/.github/actions/kamel-prepare-env/action.yml
@@ -24,7 +24,7 @@ runs:
     - name: Set Env Vars
       shell: bash
       run: |
-        if [ "$RUNNER_OS" == "Linux" ]; then
+        if [ "$RUNNER_OS" == "Linux" ] || [ "$RUNNER_OS" == "macOS" ]; then
           SUDO=sudo
         fi
 
@@ -54,10 +54,11 @@ runs:
           ${{ env.SUDO }} rm -rf "/usr/local/share/boost"
           ${{ env.SUDO }} rm -rf "$AGENT_TOOLSDIRECTORY"
         fi
-
-        df -kh
-        docker rmi $(docker image ls -aq) || true # Don't fail if image is not 
present
-        df -kh
+        if [ -x "$(command -v docker)" ]; then
+          df -kh
+          docker rmi $(docker image ls -aq) || true # Don't fail if image is 
not present
+          df -kh
+        fi
 
         echo "Final status:"
         df -h
@@ -101,6 +102,15 @@ runs:
       with:
         version: 'latest'
 
+    - id: install-realpath
+      shell: bash
+      if: ${{ env.KAMEL_PREPARE_ENV != 'true' }}
+      run : |
+        if [ "$RUNNER_OS" == "macOS" ] && ! [ -x "$(command -v realpath)" ]; 
then
+          echo 'Installing realpath...'
+          brew install coreutils
+        fi
+
     - id: complete-action
       name: Environment Prepared
       shell: bash
diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml
new file mode 100644
index 000000000..2b7b2ed6a
--- /dev/null
+++ b/.github/workflows/native.yml
@@ -0,0 +1,118 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+name: native
+
+env:
+  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+on:
+  pull_request:
+    branches:
+      - main
+      - "release-*"
+    paths-ignore:
+      - 'docs/**'
+      - 'proposals/**'
+      - '**.adoc'
+      - '**.md'
+      - 'KEYS'
+      - 'LICENSE'
+      - 'NOTICE'
+  push:
+    branches:
+      - main
+      - "release-*"
+    paths-ignore:
+      - 'docs/**'
+      - 'proposals/**'
+      - '**.adoc'
+      - '**.md'
+      - 'KEYS'
+      - 'LICENSE'
+      - 'NOTICE'
+  workflow_dispatch:
+    inputs:
+      log-level:
+        description: 'Set the operator log level (info or debug)'
+        required: false
+      pre-built-kamel-image:
+        description: 'Kamel image url for skipping building of kamel stages. 
Used for debugging'
+        required: false
+      skip-problematic:
+        description: 'Whether tests marked as problematic should be skipped - 
false by default (sets CAMEL_K_TEST_SKIP_PROBLEMATIC)'
+        required: false
+        default: false
+      test-filters:
+        description: |
+          Filter the tests in this test suite by assigning the test pattern to 
TEST_NATIVE_RUN,
+          eg. TEST_NATIVE_RUN=TestBasic will only run tests prefixed with 
'TestBasic'
+        required: false
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.sha }}
+  cancel-in-progress: true
+
+jobs:
+  install-native-high-memory:
+
+    runs-on: macos-12
+
+    steps:
+    - name: Checkout code
+      uses: actions/checkout@v2
+      with:
+        persist-credentials: false
+        submodules: recursive
+    - name: Convert input parameters to env vars
+      shell: bash
+      run: |
+        ./.github/workflows/manual-exec-process-inputs.sh \
+          -i "${{ github.event.inputs.pre-built-kamel-image }}" \
+          -p "${{ github.event.inputs.skip-problematic }}" \
+          -q "${{ github.event.inputs.log-level }}" \
+          -t "${{ github.event.inputs.test-filters }}"
+    - name: Native smoke tests
+      uses: ./.github/actions/e2e-install-native
+      with:
+        cluster-config-data: ${{ secrets.E2E_CLUSTER_CONFIG }}
+        cluster-kube-config-data: ${{ secrets.E2E_KUBE_CONFIG }}
+        high-memory: 'true'
+
+  install-native:
+
+    runs-on: macos-12
+
+    steps:
+    - name: Checkout code
+      uses: actions/checkout@v2
+      with:
+        persist-credentials: false
+        submodules: recursive
+    - name: Convert input parameters to env vars
+      shell: bash
+      run: |
+        ./.github/workflows/manual-exec-process-inputs.sh \
+          -i "${{ github.event.inputs.pre-built-kamel-image }}" \
+          -p "${{ github.event.inputs.skip-problematic }}" \
+          -q "${{ github.event.inputs.log-level }}" \
+          -t "${{ github.event.inputs.test-filters }}"
+    - name: Native smoke tests
+      uses: ./.github/actions/e2e-install-native
+      with:
+        cluster-config-data: ${{ secrets.E2E_CLUSTER_CONFIG }}
+        cluster-kube-config-data: ${{ secrets.E2E_KUBE_CONFIG }}
diff --git a/config/crd/bases/camel.apache.org_builds.yaml 
b/config/crd/bases/camel.apache.org_builds.yaml
index 8821ffd06..4b530895f 100644
--- a/config/crd/bases/camel.apache.org_builds.yaml
+++ b/config/crd/bases/camel.apache.org_builds.yaml
@@ -475,6 +475,67 @@ spec:
                           - provider
                           - version
                           type: object
+                        sources:
+                          description: the sources to add at build time
+                          items:
+                            description: SourceSpec defines the configuration 
for
+                              one or more routes to be executed in a certain 
Camel
+                              DSL language
+                            properties:
+                              compression:
+                                description: if the content is compressed 
(base64
+                                  encrypted)
+                                type: boolean
+                              content:
+                                description: the source code (plain text)
+                                type: string
+                              contentKey:
+                                description: the confimap key holding the 
source content
+                                type: string
+                              contentRef:
+                                description: the confimap reference holding 
the source
+                                  content
+                                type: string
+                              contentType:
+                                description: the content type (tipically text 
or binary)
+                                type: string
+                              interceptors:
+                                description: Interceptors are optional 
identifiers
+                                  the org.apache.camel.k.RoutesLoader uses to 
pre/post
+                                  process sources
+                                items:
+                                  type: string
+                                type: array
+                              language:
+                                description: specify which is the language 
(Camel
+                                  DSL) used to interpret this source code
+                                type: string
+                              loader:
+                                description: Loader is an optional id of the 
org.apache.camel.k.RoutesLoader
+                                  that will interpret this source at runtime
+                                type: string
+                              name:
+                                description: the name of the specification
+                                type: string
+                              path:
+                                description: the path where the file is stored
+                                type: string
+                              property-names:
+                                description: List of property names defined in 
the
+                                  source (e.g. if type is "template")
+                                items:
+                                  type: string
+                                type: array
+                              rawContent:
+                                description: the source code (binary)
+                                format: byte
+                                type: string
+                              type:
+                                description: Type defines the kind of source 
described
+                                  by this object
+                                type: string
+                            type: object
+                          type: array
                         steps:
                           description: the list of steps to execute (see 
pkg/builder/)
                           items:
diff --git a/config/crd/bases/camel.apache.org_camelcatalogs.yaml 
b/config/crd/bases/camel.apache.org_camelcatalogs.yaml
index 6fb000e75..91805a7b1 100644
--- a/config/crd/bases/camel.apache.org_camelcatalogs.yaml
+++ b/config/crd/bases/camel.apache.org_camelcatalogs.yaml
@@ -305,6 +305,11 @@ spec:
                       items:
                         type: string
                       type: array
+                    metadata:
+                      additionalProperties:
+                        type: string
+                      description: the metadata of the loader
+                      type: object
                     version:
                       description: Maven Version
                       type: string
diff --git a/config/crd/bases/camel.apache.org_integrationkits.yaml 
b/config/crd/bases/camel.apache.org_integrationkits.yaml
index 918cd6afe..b37b152b4 100644
--- a/config/crd/bases/camel.apache.org_integrationkits.yaml
+++ b/config/crd/bases/camel.apache.org_integrationkits.yaml
@@ -114,6 +114,63 @@ spec:
                 items:
                   type: string
                 type: array
+              sources:
+                description: the sources to add at build time
+                items:
+                  description: SourceSpec defines the configuration for one or 
more
+                    routes to be executed in a certain Camel DSL language
+                  properties:
+                    compression:
+                      description: if the content is compressed (base64 
encrypted)
+                      type: boolean
+                    content:
+                      description: the source code (plain text)
+                      type: string
+                    contentKey:
+                      description: the confimap key holding the source content
+                      type: string
+                    contentRef:
+                      description: the confimap reference holding the source 
content
+                      type: string
+                    contentType:
+                      description: the content type (tipically text or binary)
+                      type: string
+                    interceptors:
+                      description: Interceptors are optional identifiers the 
org.apache.camel.k.RoutesLoader
+                        uses to pre/post process sources
+                      items:
+                        type: string
+                      type: array
+                    language:
+                      description: specify which is the language (Camel DSL) 
used
+                        to interpret this source code
+                      type: string
+                    loader:
+                      description: Loader is an optional id of the 
org.apache.camel.k.RoutesLoader
+                        that will interpret this source at runtime
+                      type: string
+                    name:
+                      description: the name of the specification
+                      type: string
+                    path:
+                      description: the path where the file is stored
+                      type: string
+                    property-names:
+                      description: List of property names defined in the 
source (e.g.
+                        if type is "template")
+                      items:
+                        type: string
+                      type: array
+                    rawContent:
+                      description: the source code (binary)
+                      format: byte
+                      type: string
+                    type:
+                      description: Type defines the kind of source described 
by this
+                        object
+                      type: string
+                  type: object
+                type: array
               traits:
                 description: traits that the kit will execute
                 properties:
diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc 
b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
index 4b9e182a0..1b9414e5a 100644
--- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
+++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
@@ -665,6 +665,13 @@ string
 
 workspace directory to use
 
+|`sources` +
+*xref:#_camel_apache_org_v1_SourceSpec[[\]SourceSpec]*
+|
+
+
+the sources to add at build time
+
 
 |===
 
@@ -873,6 +880,13 @@ a list of DSLs supported
 
 a list of additional dependencies required beside the base one
 
+|`metadata` +
+map[string]string
+|
+
+
+the metadata of the loader
+
 
 |===
 
@@ -1491,6 +1505,13 @@ configuration used by the kit
 
 Maven repositories that can be used by the kit
 
+|`sources` +
+*xref:#_camel_apache_org_v1_SourceSpec[[\]SourceSpec]*
+|
+
+
+the sources to add at build time
+
 
 |===
 
@@ -3107,6 +3128,8 @@ string
 
 *Appears on:*
 
+* <<#_camel_apache_org_v1_BuilderTask, BuilderTask>>
+* <<#_camel_apache_org_v1_IntegrationKitSpec, IntegrationKitSpec>>
 * <<#_camel_apache_org_v1_IntegrationSpec, IntegrationSpec>>
 * <<#_camel_apache_org_v1_IntegrationStatus, IntegrationStatus>>
 
@@ -5406,11 +5429,9 @@ The Quarkus trait configures the Quarkus runtime.
 
 It's enabled by default.
 
-NOTE: Compiling to a native executable, i.e. when using `package-type=native`, 
is only supported
-for kamelets, as well as YAML and XML integrations.
-It also requires at least 4GiB of memory, so the Pod running the native build, 
that is either
-the operator Pod, or the build Pod (depending on the build strategy configured 
for the platform),
-must have enough memory available.
+NOTE: Compiling to a native executable, i.e. when using `package-type=native`, 
requires at least
+4GiB of memory, so the Pod running the native build, that is either the 
operator Pod, or the build
+Pod (depending on the build strategy configured for the platform), must have 
enough memory available.
 
 
 [cols="2,2a",options="header"]
diff --git a/docs/modules/traits/pages/quarkus.adoc 
b/docs/modules/traits/pages/quarkus.adoc
index 595572dd6..e0201cc13 100755
--- a/docs/modules/traits/pages/quarkus.adoc
+++ b/docs/modules/traits/pages/quarkus.adoc
@@ -5,11 +5,9 @@ The Quarkus trait configures the Quarkus runtime.
 
 It's enabled by default.
 
-NOTE: Compiling to a native executable, i.e. when using `package-type=native`, 
is only supported
-for kamelets, as well as YAML and XML integrations.
-It also requires at least 4GiB of memory, so the Pod running the native build, 
that is either
-the operator Pod, or the build Pod (depending on the build strategy configured 
for the platform),
-must have enough memory available.
+NOTE: Compiling to a native executable, i.e. when using `package-type=native`, 
requires at least
+4GiB of memory, so the Pod running the native build, that is either the 
operator Pod, or the build
+Pod (depending on the build strategy configured for the platform), must have 
enough memory available.
 
 
 This trait is available in the following profiles: **Kubernetes, Knative, 
OpenShift**.
diff --git a/e2e/namespace/native/files/Java.java 
b/e2e/namespace/native/files/Groovy.groovy
similarity index 74%
copy from e2e/namespace/native/files/Java.java
copy to e2e/namespace/native/files/Groovy.groovy
index 66fef5fe8..baeaa9c0c 100644
--- a/e2e/namespace/native/files/Java.java
+++ b/e2e/namespace/native/files/Groovy.groovy
@@ -15,14 +15,7 @@
  * limitations under the License.
  */
 
-import org.apache.camel.builder.RouteBuilder;
-
-public class Java extends RouteBuilder {
-  @Override
-  public void configure() throws Exception {
-         from("timer:tick")
-         .setHeader("m").constant("string!")
-         .setBody().simple("Magic${header.m}")
-      .log("${body}");
-  }
-}
+from('timer:tick')
+  .setHeader('m').constant('string!')
+  .setBody().simple('Magic${header.m}')
+  .log('Groovy ${body}')
diff --git a/e2e/namespace/native/files/Java.java 
b/e2e/namespace/native/files/Java.java
index 66fef5fe8..d87ff1692 100644
--- a/e2e/namespace/native/files/Java.java
+++ b/e2e/namespace/native/files/Java.java
@@ -15,14 +15,14 @@
  * limitations under the License.
  */
 
-import org.apache.camel.builder.RouteBuilder;
+ import org.apache.camel.builder.RouteBuilder;
 
-public class Java extends RouteBuilder {
-  @Override
-  public void configure() throws Exception {
-         from("timer:tick")
-         .setHeader("m").constant("string!")
-         .setBody().simple("Magic${header.m}")
-      .log("${body}");
-  }
-}
+ public class Java extends RouteBuilder {
+   @Override
+   public void configure() throws Exception {
+     from("timer:tick")
+       .setHeader("m").constant("string!")
+       .setBody().simple("Magic${header.m}")
+       .log("Java ${body}");
+   }
+ }
diff --git a/e2e/namespace/native/files/Java.java 
b/e2e/namespace/native/files/JavaScript.js
similarity index 74%
copy from e2e/namespace/native/files/Java.java
copy to e2e/namespace/native/files/JavaScript.js
index 66fef5fe8..0d3194e58 100644
--- a/e2e/namespace/native/files/Java.java
+++ b/e2e/namespace/native/files/JavaScript.js
@@ -15,14 +15,7 @@
  * limitations under the License.
  */
 
-import org.apache.camel.builder.RouteBuilder;
-
-public class Java extends RouteBuilder {
-  @Override
-  public void configure() throws Exception {
-         from("timer:tick")
-         .setHeader("m").constant("string!")
-         .setBody().simple("Magic${header.m}")
-      .log("${body}");
-  }
-}
+from('timer:tick')
+  .setHeader('m').constant('string!')
+  .setBody().simple('Magic${header.m}')
+  .log('JavaScript ${body}')
diff --git a/e2e/namespace/native/files/Java.java 
b/e2e/namespace/native/files/Kotlin.kts
similarity index 74%
copy from e2e/namespace/native/files/Java.java
copy to e2e/namespace/native/files/Kotlin.kts
index 66fef5fe8..1af1c544f 100644
--- a/e2e/namespace/native/files/Java.java
+++ b/e2e/namespace/native/files/Kotlin.kts
@@ -15,14 +15,7 @@
  * limitations under the License.
  */
 
-import org.apache.camel.builder.RouteBuilder;
-
-public class Java extends RouteBuilder {
-  @Override
-  public void configure() throws Exception {
-         from("timer:tick")
-         .setHeader("m").constant("string!")
-         .setBody().simple("Magic${header.m}")
-      .log("${body}");
-  }
-}
+from("timer:tick")
+  .setHeader("m").constant("string!")
+  .setBody().simple("Magic\${header.m}")
+  .log("Kotlin \${body}");
diff --git a/e2e/namespace/native/files/Xml.xml 
b/e2e/namespace/native/files/Xml.xml
new file mode 100644
index 000000000..7b55c2d62
--- /dev/null
+++ b/e2e/namespace/native/files/Xml.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+         http://www.apache.org/licenses/LICENSE-2.0
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+        xmlns="http://camel.apache.org/schema/spring";
+        xsi:schemaLocation="
+            http://camel.apache.org/schema/spring
+            https://camel.apache.org/schema/spring/camel-spring.xsd";>
+
+    <route id="hello">
+        <from uri="timer:tick"/>
+        <setHeader name="m">
+            <constant>string!</constant>
+        </setHeader>
+        <setBody>
+            <simple>Magic${header.m}</simple>
+        </setBody>
+        <log message="XML ${body}"/>
+    </route>
+
+</routes>
diff --git a/e2e/namespace/native/native_binding_test.go 
b/e2e/namespace/native/native_binding_test.go
index 27dc5756a..e9a749df0 100644
--- a/e2e/namespace/native/native_binding_test.go
+++ b/e2e/namespace/native/native_binding_test.go
@@ -1,5 +1,5 @@
-//go:build integration
-// +build integration
+//go:build integration && !high_memory
+// +build integration,!high_memory
 
 // To enable compilation of this file in Goland, go to "Settings -> Go -> 
Vendoring & Build Tags -> Custom Tags" and add "integration"
 
@@ -40,8 +40,8 @@ func TestNativeBinding(t *testing.T) {
                operatorID := "camel-k-native-binding"
                Expect(KamelInstallWithIDAndKameletCatalog(operatorID, ns,
                        "--build-timeout", "90m0s",
-                       "--operator-resources", "limits.memory=4.5Gi",
-                       "--maven-cli-option", 
"-Dquarkus.native.native-image-xmx=3g",
+                       "--operator-resources", "limits.memory=6.5Gi",
+                       "--maven-cli-option", 
"-Dquarkus.native.native-image-xmx=6g",
                ).Execute()).To(Succeed())
                Eventually(PlatformPhase(ns), 
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
 
@@ -98,6 +98,7 @@ func TestNativeBinding(t *testing.T) {
 
                        // Clean up
                        Expect(Kamel("delete", bindingName, "-n", 
ns).Execute()).To(Succeed())
+                       Expect(DeleteKits(ns)).To(Succeed())
                })
 
                // Clean up
diff --git a/e2e/namespace/native/native_test.go 
b/e2e/namespace/native/native_test.go
index 6ea8855b0..f1686f737 100644
--- a/e2e/namespace/native/native_test.go
+++ b/e2e/namespace/native/native_test.go
@@ -1,5 +1,5 @@
-//go:build integration
-// +build integration
+//go:build integration && !high_memory
+// +build integration,!high_memory
 
 // To enable compilation of this file in Goland, go to "Settings -> Go -> 
Vendoring & Build Tags -> Custom Tags" and add "integration"
 
@@ -38,14 +38,14 @@ func TestNativeIntegrations(t *testing.T) {
                operatorID := "camel-k-quarkus-native"
                Expect(KamelInstallWithID(operatorID, ns,
                        "--build-timeout", "90m0s",
-                       "--operator-resources", "limits.memory=4.5Gi",
-                       "--maven-cli-option", 
"-Dquarkus.native.native-image-xmx=3g",
+                       "--operator-resources", "limits.memory=6.5Gi",
+                       "--maven-cli-option", 
"-Dquarkus.native.native-image-xmx=6g",
                ).Execute()).To(Succeed())
                Eventually(PlatformPhase(ns), 
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
 
                t.Run("unsupported integration source language", func(t 
*testing.T) {
-                       name := "unsupported-java"
-                       Expect(KamelRunWithID(operatorID, ns, 
"files/Java.java", "--name", name,
+                       name := "unsupported-js"
+                       Expect(KamelRunWithID(operatorID, ns, 
"files/JavaScript.js", "--name", name,
                                "-t", "quarkus.package-type=native",
                        ).Execute()).To(Succeed())
 
@@ -57,6 +57,24 @@ func TestNativeIntegrations(t *testing.T) {
                        Expect(Kamel("delete", name, "-n", 
ns).Execute()).To(Succeed())
                })
 
+               t.Run("xml native support", func(t *testing.T) {
+                       name := "xml-native"
+                       Expect(KamelRunWithID(operatorID, ns, "files/Xml.xml", 
"--name", name,
+                               "-t", "quarkus.package-type=native",
+                       ).Execute()).To(Succeed())
+
+                       Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutVeryLong).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPod(ns, name), TestTimeoutShort).
+                               Should(WithTransform(getContainerCommand(), 
MatchRegexp(".*camel-k-integration-\\d+\\.\\d+\\.\\d+[-A-Za-z]*-runner.*")))
+                       Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), TestTimeoutShort).
+                               Should(Equal(corev1.ConditionTrue))
+
+                       Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("XML Magicstring!"))
+
+                       // Clean up
+                       Expect(Kamel("delete", name, "-n", 
ns).Execute()).To(Succeed())
+               })
+
                t.Run("warm up before native build testing", func(t *testing.T) 
{
                        // The following native build test is under tight time 
constraints, so here it runs
                        // a warm up testing to make sure necessary jars are 
already downloaded.
@@ -117,13 +135,16 @@ func TestNativeIntegrations(t *testing.T) {
                        Eventually(IntegrationPodImage(ns, 
name)).Should(Equal(nativeKit.Status.Image))
 
                        // Check the Integration is still ready
-                       Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutLong).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutVeryLong).Should(Equal(corev1.PodRunning))
                        Eventually(IntegrationPod(ns, name), TestTimeoutShort).
                                Should(WithTransform(getContainerCommand(), 
MatchRegexp(".*camel-k-integration-\\d+\\.\\d+\\.\\d+[-A-Za-z]*-runner.*")))
                        Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), TestTimeoutShort).
                                Should(Equal(corev1.ConditionTrue))
 
                        Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+
+                       // Clean up
+                       Expect(Kamel("delete", name, "-n", 
ns).Execute()).To(Succeed())
                })
 
                // Clean up
diff --git a/e2e/namespace/native/native_with_sources_test.go 
b/e2e/namespace/native/native_with_sources_test.go
new file mode 100644
index 000000000..fc39ace54
--- /dev/null
+++ b/e2e/namespace/native/native_with_sources_test.go
@@ -0,0 +1,103 @@
+//go:build integration && high_memory
+// +build integration,high_memory
+
+// To enable compilation of this file in Goland, go to "Settings -> Go -> 
Vendoring & Build Tags -> Custom Tags" and add "integration"
+
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package native
+
+import (
+       "testing"
+
+       . "github.com/onsi/gomega"
+
+       corev1 "k8s.io/api/core/v1"
+
+       . "github.com/apache/camel-k/e2e/support"
+       v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+)
+
+func TestNativeHighMemoryIntegrations(t *testing.T) {
+       WithNewTestNamespace(t, func(ns string) {
+               operatorID := "camel-k-quarkus-high-memory-native"
+               Expect(KamelInstallWithID(operatorID, ns,
+                       "--build-timeout", "90m0s",
+                       "--operator-resources", "limits.memory=9.5Gi",
+                       "--maven-cli-option", 
"-Dquarkus.native.native-image-xmx=9g",
+               ).Execute()).To(Succeed())
+               Eventually(PlatformPhase(ns), 
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+               t.Run("java native support", func(t *testing.T) {
+                       name := "java-native"
+                       Expect(KamelRunWithID(operatorID, ns, 
"files/Java.java", "--name", name,
+                               "-t", "quarkus.package-type=native",
+                       ).Execute()).To(Succeed())
+
+                       Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutVeryLong).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPod(ns, name), TestTimeoutShort).
+                               Should(WithTransform(getContainerCommand(), 
MatchRegexp(".*camel-k-integration-\\d+\\.\\d+\\.\\d+[-A-Za-z]*-runner.*")))
+                       Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), TestTimeoutShort).
+                               Should(Equal(corev1.ConditionTrue))
+
+                       Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Java Magicstring!"))
+
+                       // Clean up
+                       Expect(Kamel("delete", name, "-n", 
ns).Execute()).To(Succeed())
+               })
+
+               t.Run("groovy native support", func(t *testing.T) {
+                       name := "groovy-native"
+                       Expect(KamelRunWithID(operatorID, ns, 
"files/Groovy.groovy", "--name", name,
+                               "-t", "quarkus.package-type=native",
+                       ).Execute()).To(Succeed())
+
+                       Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutVeryLong).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPod(ns, name), TestTimeoutShort).
+                               Should(WithTransform(getContainerCommand(), 
MatchRegexp(".*camel-k-integration-\\d+\\.\\d+\\.\\d+[-A-Za-z]*-runner.*")))
+                       Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), TestTimeoutShort).
+                               Should(Equal(corev1.ConditionTrue))
+
+                       Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Groovy Magicstring!"))
+
+                       // Clean up
+                       Expect(Kamel("delete", name, "-n", 
ns).Execute()).To(Succeed())
+               })
+
+               t.Run("kotlin native support", func(t *testing.T) {
+                       name := "kotlin-native"
+                       Expect(KamelRunWithID(operatorID, ns, 
"files/Kotlin.kts", "--name", name,
+                               "-t", "quarkus.package-type=native",
+                       ).Execute()).To(Succeed())
+
+                       Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutVeryLong).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPod(ns, name), TestTimeoutShort).
+                               Should(WithTransform(getContainerCommand(), 
MatchRegexp(".*camel-k-integration-\\d+\\.\\d+\\.\\d+[-A-Za-z]*-runner.*")))
+                       Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), TestTimeoutShort).
+                               Should(Equal(corev1.ConditionTrue))
+
+                       Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Kotlin Magicstring!"))
+
+                       // Clean up
+                       Expect(Kamel("delete", name, "-n", 
ns).Execute()).To(Succeed())
+               })
+
+               // Clean up
+               Expect(Kamel("delete", "--all", "-n", 
ns).Execute()).To(Succeed())
+       })
+}
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 7bcbb29ad..66a24ed45 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -93,10 +93,10 @@ const kubeConfigEnvVar = "KUBECONFIG"
 
 var TestTimeoutShort = 1 * time.Minute
 var TestTimeoutMedium = 5 * time.Minute
-var TestTimeoutLong = 10 * time.Minute
+var TestTimeoutLong = 15 * time.Minute
 
 // TestTimeoutVeryLong should be used only for testing native builds.
-var TestTimeoutVeryLong = 90 * time.Minute
+var TestTimeoutVeryLong = 60 * time.Minute
 
 var NoOlmOperatorImage string
 
diff --git a/helm/camel-k/crds/crd-build.yaml b/helm/camel-k/crds/crd-build.yaml
index 8821ffd06..4b530895f 100644
--- a/helm/camel-k/crds/crd-build.yaml
+++ b/helm/camel-k/crds/crd-build.yaml
@@ -475,6 +475,67 @@ spec:
                           - provider
                           - version
                           type: object
+                        sources:
+                          description: the sources to add at build time
+                          items:
+                            description: SourceSpec defines the configuration 
for
+                              one or more routes to be executed in a certain 
Camel
+                              DSL language
+                            properties:
+                              compression:
+                                description: if the content is compressed 
(base64
+                                  encrypted)
+                                type: boolean
+                              content:
+                                description: the source code (plain text)
+                                type: string
+                              contentKey:
+                                description: the confimap key holding the 
source content
+                                type: string
+                              contentRef:
+                                description: the confimap reference holding 
the source
+                                  content
+                                type: string
+                              contentType:
+                                description: the content type (tipically text 
or binary)
+                                type: string
+                              interceptors:
+                                description: Interceptors are optional 
identifiers
+                                  the org.apache.camel.k.RoutesLoader uses to 
pre/post
+                                  process sources
+                                items:
+                                  type: string
+                                type: array
+                              language:
+                                description: specify which is the language 
(Camel
+                                  DSL) used to interpret this source code
+                                type: string
+                              loader:
+                                description: Loader is an optional id of the 
org.apache.camel.k.RoutesLoader
+                                  that will interpret this source at runtime
+                                type: string
+                              name:
+                                description: the name of the specification
+                                type: string
+                              path:
+                                description: the path where the file is stored
+                                type: string
+                              property-names:
+                                description: List of property names defined in 
the
+                                  source (e.g. if type is "template")
+                                items:
+                                  type: string
+                                type: array
+                              rawContent:
+                                description: the source code (binary)
+                                format: byte
+                                type: string
+                              type:
+                                description: Type defines the kind of source 
described
+                                  by this object
+                                type: string
+                            type: object
+                          type: array
                         steps:
                           description: the list of steps to execute (see 
pkg/builder/)
                           items:
diff --git a/helm/camel-k/crds/crd-camel-catalog.yaml 
b/helm/camel-k/crds/crd-camel-catalog.yaml
index 6fb000e75..91805a7b1 100644
--- a/helm/camel-k/crds/crd-camel-catalog.yaml
+++ b/helm/camel-k/crds/crd-camel-catalog.yaml
@@ -305,6 +305,11 @@ spec:
                       items:
                         type: string
                       type: array
+                    metadata:
+                      additionalProperties:
+                        type: string
+                      description: the metadata of the loader
+                      type: object
                     version:
                       description: Maven Version
                       type: string
diff --git a/helm/camel-k/crds/crd-integration-kit.yaml 
b/helm/camel-k/crds/crd-integration-kit.yaml
index 918cd6afe..b37b152b4 100644
--- a/helm/camel-k/crds/crd-integration-kit.yaml
+++ b/helm/camel-k/crds/crd-integration-kit.yaml
@@ -114,6 +114,63 @@ spec:
                 items:
                   type: string
                 type: array
+              sources:
+                description: the sources to add at build time
+                items:
+                  description: SourceSpec defines the configuration for one or 
more
+                    routes to be executed in a certain Camel DSL language
+                  properties:
+                    compression:
+                      description: if the content is compressed (base64 
encrypted)
+                      type: boolean
+                    content:
+                      description: the source code (plain text)
+                      type: string
+                    contentKey:
+                      description: the confimap key holding the source content
+                      type: string
+                    contentRef:
+                      description: the confimap reference holding the source 
content
+                      type: string
+                    contentType:
+                      description: the content type (tipically text or binary)
+                      type: string
+                    interceptors:
+                      description: Interceptors are optional identifiers the 
org.apache.camel.k.RoutesLoader
+                        uses to pre/post process sources
+                      items:
+                        type: string
+                      type: array
+                    language:
+                      description: specify which is the language (Camel DSL) 
used
+                        to interpret this source code
+                      type: string
+                    loader:
+                      description: Loader is an optional id of the 
org.apache.camel.k.RoutesLoader
+                        that will interpret this source at runtime
+                      type: string
+                    name:
+                      description: the name of the specification
+                      type: string
+                    path:
+                      description: the path where the file is stored
+                      type: string
+                    property-names:
+                      description: List of property names defined in the 
source (e.g.
+                        if type is "template")
+                      items:
+                        type: string
+                      type: array
+                    rawContent:
+                      description: the source code (binary)
+                      format: byte
+                      type: string
+                    type:
+                      description: Type defines the kind of source described 
by this
+                        object
+                      type: string
+                  type: object
+                type: array
               traits:
                 description: traits that the kit will execute
                 properties:
diff --git a/pkg/apis/camel/v1/build_types.go b/pkg/apis/camel/v1/build_types.go
index 675472984..de1101864 100644
--- a/pkg/apis/camel/v1/build_types.go
+++ b/pkg/apis/camel/v1/build_types.go
@@ -74,6 +74,8 @@ type BuilderTask struct {
        Maven MavenBuildSpec `json:"maven,omitempty"`
        // workspace directory to use
        BuildDir string `json:"buildDir,omitempty"`
+       // the sources to add at build time
+       Sources []SourceSpec `json:"sources,omitempty"`
 }
 
 // MavenBuildSpec defines the Maven configuration plus additional repositories 
to use
diff --git a/pkg/apis/camel/v1/camelcatalog_types.go 
b/pkg/apis/camel/v1/camelcatalog_types.go
index 09f1fb1e3..222fba0c3 100644
--- a/pkg/apis/camel/v1/camelcatalog_types.go
+++ b/pkg/apis/camel/v1/camelcatalog_types.go
@@ -128,4 +128,6 @@ type CamelLoader struct {
        Languages []string `json:"languages,omitempty" 
yaml:"languages,omitempty"`
        // a list of additional dependencies required beside the base one
        Dependencies []MavenArtifact `json:"dependencies,omitempty" 
yaml:"dependencies,omitempty"`
+       // the metadata of the loader
+       Metadata map[string]string `json:"metadata,omitempty" 
yaml:"metadata,omitempty"`
 }
diff --git a/pkg/apis/camel/v1/common_types.go 
b/pkg/apis/camel/v1/common_types.go
index f79ce47fc..1fffa94b1 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -426,6 +426,8 @@ const (
        LanguageYaml Language = "yaml"
        // LanguageKamelet used for Kamelets
        LanguageKamelet Language = "kamelet"
+       // LanguageJavaShell used for Java Shell
+       LanguageJavaShell Language = "jsh"
 )
 
 // Languages is the list of all supported languages
@@ -437,4 +439,5 @@ var Languages = []Language{
        LanguageKotlin,
        LanguageYaml,
        LanguageKamelet,
+       LanguageJavaShell,
 }
diff --git a/pkg/apis/camel/v1/integrationkit_types.go 
b/pkg/apis/camel/v1/integrationkit_types.go
index a94506388..5510561a6 100644
--- a/pkg/apis/camel/v1/integrationkit_types.go
+++ b/pkg/apis/camel/v1/integrationkit_types.go
@@ -69,6 +69,8 @@ type IntegrationKitSpec struct {
        Configuration []ConfigurationSpec `json:"configuration,omitempty"`
        // Maven repositories that can be used by the kit
        Repositories []string `json:"repositories,omitempty"`
+       // the sources to add at build time
+       Sources []SourceSpec `json:"sources,omitempty"`
 }
 
 // IntegrationKitTraits defines traits assigned to an `IntegrationKit`
diff --git a/pkg/apis/camel/v1/trait/quarkus.go 
b/pkg/apis/camel/v1/trait/quarkus.go
index dcbd079d6..571ad6206 100644
--- a/pkg/apis/camel/v1/trait/quarkus.go
+++ b/pkg/apis/camel/v1/trait/quarkus.go
@@ -21,11 +21,9 @@ package trait
 //
 // It's enabled by default.
 //
-// NOTE: Compiling to a native executable, i.e. when using 
`package-type=native`, is only supported
-// for kamelets, as well as YAML and XML integrations.
-// It also requires at least 4GiB of memory, so the Pod running the native 
build, that is either
-// the operator Pod, or the build Pod (depending on the build strategy 
configured for the platform),
-// must have enough memory available.
+// NOTE: Compiling to a native executable, i.e. when using 
`package-type=native`, requires at least
+// 4GiB of memory, so the Pod running the native build, that is either the 
operator Pod, or the build
+// Pod (depending on the build strategy configured for the platform), must 
have enough memory available.
 //
 // +camel-k:trait=quarkus.
 type QuarkusTrait struct {
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go 
b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index 6d4e1d5f0..dfb1dcde6 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -235,6 +235,13 @@ func (in *BuilderTask) DeepCopyInto(out *BuilderTask) {
                copy(*out, *in)
        }
        in.Maven.DeepCopyInto(&out.Maven)
+       if in.Sources != nil {
+               in, out := &in.Sources, &out.Sources
+               *out = make([]SourceSpec, len(*in))
+               for i := range *in {
+                       (*in)[i].DeepCopyInto(&(*out)[i])
+               }
+       }
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new BuilderTask.
@@ -446,6 +453,13 @@ func (in *CamelLoader) DeepCopyInto(out *CamelLoader) {
                *out = make([]MavenArtifact, len(*in))
                copy(*out, *in)
        }
+       if in.Metadata != nil {
+               in, out := &in.Metadata, &out.Metadata
+               *out = make(map[string]string, len(*in))
+               for key, val := range *in {
+                       (*out)[key] = val
+               }
+       }
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new CamelLoader.
@@ -797,6 +811,13 @@ func (in *IntegrationKitSpec) DeepCopyInto(out 
*IntegrationKitSpec) {
                *out = make([]string, len(*in))
                copy(*out, *in)
        }
+       if in.Sources != nil {
+               in, out := &in.Sources, &out.Sources
+               *out = make([]SourceSpec, len(*in))
+               for i := range *in {
+                       (*in)[i].DeepCopyInto(&(*out)[i])
+               }
+       }
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new IntegrationKitSpec.
diff --git a/pkg/builder/quarkus.go b/pkg/builder/quarkus.go
index 91d6bfa33..0fe32c832 100644
--- a/pkg/builder/quarkus.go
+++ b/pkg/builder/quarkus.go
@@ -30,7 +30,9 @@ import (
        "github.com/apache/camel-k/pkg/util/camel"
        "github.com/apache/camel-k/pkg/util/defaults"
        "github.com/apache/camel-k/pkg/util/digest"
+       "github.com/apache/camel-k/pkg/util/kubernetes"
        "github.com/apache/camel-k/pkg/util/maven"
+       corev1 "k8s.io/api/core/v1"
 )
 
 func init() {
@@ -48,6 +50,7 @@ type quarkusSteps struct {
        GenerateQuarkusProject     Step
        BuildQuarkusRunner         Step
        ComputeQuarkusDependencies Step
+       PrepareProjectWithSources  Step
 
        CommonSteps []Step
 }
@@ -55,10 +58,58 @@ type quarkusSteps struct {
 var Quarkus = quarkusSteps{
        LoadCamelQuarkusCatalog:    NewStep(InitPhase, loadCamelQuarkusCatalog),
        GenerateQuarkusProject:     NewStep(ProjectGenerationPhase, 
generateQuarkusProject),
+       PrepareProjectWithSources:  NewStep(ProjectBuildPhase-1, 
prepareProjectWithSources),
        BuildQuarkusRunner:         NewStep(ProjectBuildPhase, 
buildQuarkusRunner),
        ComputeQuarkusDependencies: NewStep(ProjectBuildPhase+1, 
computeQuarkusDependencies),
 }
 
+func resolveBuildSources(ctx *builderContext) ([]v1.SourceSpec, error) {
+       resources := kubernetes.NewCollection()
+       return kubernetes.ResolveSources(ctx.Build.Sources, func(name string) 
(*corev1.ConfigMap, error) {
+               // the config map could be part of the resources created
+               // by traits
+               cm := resources.GetConfigMap(func(m *corev1.ConfigMap) bool {
+                       return m.Name == name
+               })
+
+               if cm != nil {
+                       return cm, nil
+               }
+
+               return kubernetes.GetConfigMap(ctx.C, ctx.Client, name, 
ctx.Namespace)
+       })
+}
+
+func prepareProjectWithSources(ctx *builderContext) error {
+       sources, err := resolveBuildSources(ctx)
+       if err != nil {
+               return err
+       }
+       sourcesPath := filepath.Join(ctx.Path, "maven", "src", "main", 
"resources", "routes")
+       if err := os.MkdirAll(sourcesPath, os.ModePerm); err != nil {
+               return errors.Wrap(err, "failure while creating resource 
folder")
+       }
+
+       sourceList := ""
+       for _, source := range sources {
+               if sourceList != "" {
+                       sourceList += ","
+               }
+               sourceList += "classpath:routes/" + source.Name
+               if err := os.WriteFile(filepath.Join(sourcesPath, source.Name), 
[]byte(source.Content), os.ModePerm); err != nil {
+                       return errors.Wrapf(err, "failure while writing %s", 
source.Name)
+               }
+       }
+
+       if sourceList != "" {
+               routesIncludedPattern := "camel.main.routes-include-pattern = " 
+ sourceList
+               if err := os.WriteFile(filepath.Join(filepath.Dir(sourcesPath), 
"application.properties"), []byte(routesIncludedPattern), os.ModePerm); err != 
nil {
+                       return errors.Wrapf(err, "failure while writing the 
configuration application.properties")
+               }
+       }
+       return nil
+}
+
 func loadCamelQuarkusCatalog(ctx *builderContext) error {
        catalog, err := camel.LoadCatalog(ctx.C, ctx.Client, ctx.Namespace, 
ctx.Build.Runtime)
        if err != nil {
@@ -196,7 +247,7 @@ func BuildQuarkusRunnerCommon(ctx context.Context, mc 
maven.Context, project mav
        // may fail the build.
        // In the future there should be a way to provide build information 
from secrets,
        // configmap, etc.
-       if _, err := os.Create(filepath.Join(resourcesPath, 
"application.properties")); err != nil {
+       if _, err := os.OpenFile(filepath.Join(resourcesPath, 
"application.properties"), os.O_RDWR|os.O_CREATE, 0666); err != nil {
                return errors.Wrap(err, "failure while creating 
application.properties")
        }
 
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/buildertask.go 
b/pkg/client/camel/applyconfiguration/camel/v1/buildertask.go
index 2cbaa72bd..ceea83625 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/buildertask.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/buildertask.go
@@ -29,6 +29,7 @@ type BuilderTaskApplyConfiguration struct {
        Steps                      []string                          
`json:"steps,omitempty"`
        Maven                      *MavenBuildSpecApplyConfiguration 
`json:"maven,omitempty"`
        BuildDir                   *string                           
`json:"buildDir,omitempty"`
+       Sources                    []SourceSpecApplyConfiguration    
`json:"sources,omitempty"`
 }
 
 // BuilderTaskApplyConfiguration constructs an declarative configuration of 
the BuilderTask type for use with
@@ -96,3 +97,16 @@ func (b *BuilderTaskApplyConfiguration) WithBuildDir(value 
string) *BuilderTaskA
        b.BuildDir = &value
        return b
 }
+
+// WithSources adds the given value to the Sources field in the declarative 
configuration
+// and returns the receiver, so that objects can be build by chaining "With" 
function invocations.
+// If called multiple times, values provided by each call will be appended to 
the Sources field.
+func (b *BuilderTaskApplyConfiguration) WithSources(values 
...*SourceSpecApplyConfiguration) *BuilderTaskApplyConfiguration {
+       for i := range values {
+               if values[i] == nil {
+                       panic("nil value passed to WithSources")
+               }
+               b.Sources = append(b.Sources, *values[i])
+       }
+       return b
+}
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/camelloader.go 
b/pkg/client/camel/applyconfiguration/camel/v1/camelloader.go
index 2867b58d4..9ebf7d1e4 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/camelloader.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/camelloader.go
@@ -25,6 +25,7 @@ type CamelLoaderApplyConfiguration struct {
        MavenArtifactApplyConfiguration `json:",inline"`
        Languages                       []string                          
`json:"languages,omitempty"`
        Dependencies                    []MavenArtifactApplyConfiguration 
`json:"dependencies,omitempty"`
+       Metadata                        map[string]string                 
`json:"metadata,omitempty"`
 }
 
 // CamelLoaderApplyConfiguration constructs an declarative configuration of 
the CamelLoader type for use with
@@ -79,3 +80,17 @@ func (b *CamelLoaderApplyConfiguration) 
WithDependencies(values ...*MavenArtifac
        }
        return b
 }
+
+// WithMetadata puts the entries into the Metadata field in the declarative 
configuration
+// and returns the receiver, so that objects can be build by chaining "With" 
function invocations.
+// If called multiple times, the entries provided by each call will be put on 
the Metadata field,
+// overwriting an existing map entries in Metadata field with the same key.
+func (b *CamelLoaderApplyConfiguration) WithMetadata(entries 
map[string]string) *CamelLoaderApplyConfiguration {
+       if b.Metadata == nil && len(entries) > 0 {
+               b.Metadata = make(map[string]string, len(entries))
+       }
+       for k, v := range entries {
+               b.Metadata[k] = v
+       }
+       return b
+}
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/integrationkitspec.go 
b/pkg/client/camel/applyconfiguration/camel/v1/integrationkitspec.go
index 08d6ae153..9b408fe8d 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/integrationkitspec.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/integrationkitspec.go
@@ -32,6 +32,7 @@ type IntegrationKitSpecApplyConfiguration struct {
        Traits        *IntegrationKitTraitsApplyConfiguration 
`json:"traits,omitempty"`
        Configuration []ConfigurationSpecApplyConfiguration   
`json:"configuration,omitempty"`
        Repositories  []string                                
`json:"repositories,omitempty"`
+       Sources       []SourceSpecApplyConfiguration          
`json:"sources,omitempty"`
 }
 
 // IntegrationKitSpecApplyConfiguration constructs an declarative 
configuration of the IntegrationKitSpec type for use with
@@ -96,3 +97,16 @@ func (b *IntegrationKitSpecApplyConfiguration) 
WithRepositories(values ...string
        }
        return b
 }
+
+// WithSources adds the given value to the Sources field in the declarative 
configuration
+// and returns the receiver, so that objects can be build by chaining "With" 
function invocations.
+// If called multiple times, values provided by each call will be appended to 
the Sources field.
+func (b *IntegrationKitSpecApplyConfiguration) WithSources(values 
...*SourceSpecApplyConfiguration) *IntegrationKitSpecApplyConfiguration {
+       for i := range values {
+               if values[i] == nil {
+                       panic("nil value passed to WithSources")
+               }
+               b.Sources = append(b.Sources, *values[i])
+       }
+       return b
+}
diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index 638688261..6a9d81f16 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -117,23 +117,23 @@ var assets = func() http.FileSystem {
                "/crd/bases/camel.apache.org_builds.yaml": 
&vfsgen۰CompressedFileInfo{
                        name:             "camel.apache.org_builds.yaml",
                        modTime:          time.Time{},
-                       uncompressedSize: 35823,
+                       uncompressedSize: 39199,
 
-                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3d\x5d\x93\xdb\x36\x92\xef\xfa\x15\x5d\x99\x07\x8f\xab\xf4\x91\xaf\xcd\xe5\xe6\xea\xea\x4a\x3b\x8e\xb3\x73\x8e\x3d\x3e\x6b\xe2\x24\x6f\x03\x91\x2d\x09\x11\x09\xf0\x00\x70\x64\xed\xd5\xfd\xf7\x2b\x34\x40\x8a\x92\xf8\x01\xce\x68\xe2\xbd\x8d\xf0\x62\x0f\x05\x36\x1a\xfd\x8d\x46\x13\xb8\x80\xd1\xe9\xda\xe0\x02\x7e\xe2\x11\x0a\x8d\x31\x18\x09\x66\x85\x30\xcd\x58\xb4\x42\x98\xc9\x85\xd9\x30\x85\xf0\x5a\xe6\x22\x66\x86\x
 [...]
+                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3d\x6b\x73\x23\x29\x92\xdf\xfd\x2b\x32\xc6\x1f\xda\x1d\x61\x49\x33\xb3\x8f\x9b\xf3\xc5\xc5\x85\xd6\x3d\x33\xeb\xeb\x87\xfb\x5a\x9e\xde\xdd\x6f\x46\x55\x29\x89\x55\x15\xd4\x01\x65\xb5\xf6\xe2\xfe\xfb\x05\x09\x94\x4a\x52\x3d\x28\x3f\xa6\xf7\x76\xc5\x97\x6e\x97\x20\x49\xc8\x24\x5f\x24\x70\x0e\xa3\xe7\x2b\x67\xe7\xf0\x8e\x27\x28\x34\xa6\x60\x24\x98\x15\xc2\xb4\x60\xc9\x0a\x61\x26\x17\x66\xc3\x14\xc2\x4f\xb2\x14\x29\x
 [...]
                },
                "/crd/bases/camel.apache.org_camelcatalogs.yaml": 
&vfsgen۰CompressedFileInfo{
                        name:             "camel.apache.org_camelcatalogs.yaml",
                        modTime:          time.Time{},
-                       uncompressedSize: 17698,
+                       uncompressedSize: 17906,
 
-                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5c\x4f\x73\xdb\xb8\x15\xbf\xf3\x53\xbc\x89\x0e\x49\x66\x24\x6a\xd3\xce\x74\x3a\xea\xc9\xb5\x9d\x5d\x35\x5e\x3b\xb5\x94\xec\xec\x11\x22\x9f\x28\xc4\x24\xc0\x02\xa0\x64\x6d\xa7\xdf\xbd\x03\x80\x14\x49\x89\x7f\x40\xd9\x9e\xec\xce\x1a\x27\x8b\x00\x1e\x7e\x78\xff\x1f\x48\x78\x04\x93\xe7\x6b\xde\x08\x6e\x68\x80\x4c\x62\x08\x8a\x83\xda\x20\x5c\xa4\x24\xd8\x20\x2c\xf8\x5a\xed\x88\x40\xf8\xc8\x33\x16\x12\x45\x39\x83\x77\x
 [...]
+                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5c\x4f\x73\xdb\xb8\x15\xbf\xf3\x53\xbc\x89\x0e\x49\x66\x24\x6a\xd3\xce\x74\x3a\xea\xc9\xb5\x9d\x5d\x35\x5e\x3b\xb5\x94\xec\xec\x11\x22\x9f\x28\xc4\x24\xc0\x02\xa0\x64\x6d\xa7\xdf\xbd\x03\x80\x14\x49\x89\x7f\x40\xd9\x9e\xec\xce\x1a\x27\x8b\x00\x1e\x7e\x78\xff\x1f\x08\x7a\x04\x93\xe7\x6b\xde\x08\x6e\x68\x80\x4c\x62\x08\x8a\x83\xda\x20\x5c\xa4\x24\xd8\x20\x2c\xf8\x5a\xed\x88\x40\xf8\xc8\x33\x16\x12\x45\x39\x83\x77\x
 [...]
                },
                "/crd/bases/camel.apache.org_integrationkits.yaml": 
&vfsgen۰CompressedFileInfo{
                        name:             
"camel.apache.org_integrationkits.yaml",
                        modTime:          time.Time{},
-                       uncompressedSize: 16165,
+                       uncompressedSize: 18839,
 
-                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x4f\x73\xdb\xb8\x92\xbf\xeb\x53\x74\x8d\x0f\x49\xaa\x24\xfa\xcd\xee\xab\x57\x5b\xde\xda\x83\x9f\x27\x99\xe7\x4a\xe2\x64\x63\x67\xde\x4e\x55\x0e\x6e\x91\x2d\x0a\x23\x12\xe0\x00\xa0\x64\xed\xd6\x7e\xf7\xad\x6e\x80\x14\x25\x91\x94\xc6\x99\xec\x29\xbc\x24\x26\x81\x46\xff\xfd\x75\x37\x00\x5d\xc0\xec\xcf\x7b\x26\x17\xf0\x4e\xa5\xa4\x1d\x65\xe0\x0d\xf8\x25\xc1\x75\x85\xe9\x92\xe0\xde\x2c\xfc\x06\x2d\xc1\x1b\x53\xeb\x
 [...]
+                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3c\x4d\x73\xdb\xb8\x92\x77\xfd\x8a\xae\xf8\x10\xbb\x4a\xa2\xdf\xec\xbe\x9a\xda\xf2\xd6\x1e\xfc\x9c\x64\x9e\x2b\x8e\x93\x8d\x9c\x79\x3b\x55\x73\x70\x8b\x6c\x49\x18\x91\x00\x1f\x00\x4a\xd6\x6e\xed\x7f\xdf\x42\x03\xa0\x28\x89\xa4\x18\x7b\xbc\xa7\xf0\x32\xb1\x08\x34\xfa\xfb\x03\xdd\x9c\x33\x98\xfc\x79\xcf\xe8\x0c\xee\x44\x4a\xd2\x50\x06\x56\x81\x5d\x12\x5c\x97\x98\x2e\x09\xa6\x6a\x6e\x37\xa8\x09\x3e\xa8\x4a\x66\x68\x
 [...]
                },
                "/crd/bases/camel.apache.org_integrationplatforms.yaml": 
&vfsgen۰CompressedFileInfo{
                        name:             
"camel.apache.org_integrationplatforms.yaml",
@@ -611,9 +611,9 @@ var assets = func() http.FileSystem {
                "/traits.yaml": &vfsgen۰CompressedFileInfo{
                        name:             "traits.yaml",
                        modTime:          time.Time{},
-                       uncompressedSize: 64160,
+                       uncompressedSize: 64078,
 
-                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xfd\x77\x1b\x37\x92\xe0\xef\xfe\x2b\xf0\xb8\xb7\x4f\x92\x4f\xa4\x94\xcc\x66\x36\xab\x3b\xef\x9c\xe2\x38\x33\x4a\xfc\xa1\xb3\x94\xcc\xce\xf3\xf9\x0d\xc1\x6e\x90\x84\xd9\x04\x3a\x00\x5a\x32\x73\x73\xff\xfb\x3d\x54\x15\x3e\xba\xd9\x14\x49\x5b\xca\x8e\x76\xb2\xfb\xde\xc4\x92\x1a\x85\x42\xa1\x50\x28\xd4\xa7\x33\x5c\x3a\x7b\xf6\x64\xc8\x14\x5f\x8a\x33\xf6\x3b\x5b\xf0\x4a\x3c\x61\xac\xae\xb8\x9b\x6a\xb3\x3c\x63\x53\x
 [...]
+                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\xff\x77\x1b\x37\x92\x20\xfe\xbb\xff\x0a\x3c\xee\x67\x9f\x24\x7f\x44\x4a\xc9\x6c\x66\xb3\xba\xf3\xce\x29\x8e\x33\xa3\x24\xb6\x75\x96\x92\xb9\x79\x3e\xbf\x21\xd8\x0d\x92\x30\x9b\x40\x0f\x80\x96\xcc\xdc\xde\xff\x7e\x0f\x55\x85\x2f\xdd\x6c\x8a\xa4\x2c\x65\x47\x3b\xd9\x7d\x6f\x62\x49\x8d\x42\xa1\x50\x28\x14\xea\xab\x33\x5c\x3a\x7b\xf6\x6c\xc8\x14\x5f\x8a\x33\xf6\x3b\x5b\xf0\x4a\x3c\x63\xac\xae\xb8\x9b\x6a\xb3\x3c\x
 [...]
                },
        }
        fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 26d87c589..50348255c 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -217,7 +217,7 @@ func (t *camelTrait) computeConfigMaps(e *Environment) 
[]ctrl.Object {
        }
 
        for i, s := range sources {
-               if s.ContentRef != "" {
+               if s.ContentRef != "" || e.isEmbedded(s) {
                        continue
                }
 
diff --git a/pkg/trait/camel_test.go b/pkg/trait/camel_test.go
index 80fd1d43b..de4e767b0 100644
--- a/pkg/trait/camel_test.go
+++ b/pkg/trait/camel_test.go
@@ -34,7 +34,7 @@ import (
 )
 
 func TestConfigureEnabledCamelTraitSucceeds(t *testing.T) {
-       trait, environment := createNominalCamelTest()
+       trait, environment := createNominalCamelTest(false)
 
        configured, err := trait.Configure(environment)
        assert.Nil(t, err)
@@ -42,7 +42,7 @@ func TestConfigureEnabledCamelTraitSucceeds(t *testing.T) {
 }
 
 func TestConfigureDisabledCamelTraitFails(t *testing.T) {
-       trait, environment := createNominalCamelTest()
+       trait, environment := createNominalCamelTest(false)
        trait.Enabled = pointer.Bool(false)
 
        configured, err := trait.Configure(environment)
@@ -51,7 +51,7 @@ func TestConfigureDisabledCamelTraitFails(t *testing.T) {
 }
 
 func TestApplyCamelTraitSucceeds(t *testing.T) {
-       trait, environment := createNominalCamelTest()
+       trait, environment := createNominalCamelTest(false)
 
        configured, err := trait.Configure(environment)
        assert.Nil(t, err)
@@ -65,7 +65,7 @@ func TestApplyCamelTraitSucceeds(t *testing.T) {
 }
 
 func TestApplyCamelTraitWithoutEnvironmentCatalogAndUnmatchableVersionFails(t 
*testing.T) {
-       trait, environment := createNominalCamelTest()
+       trait, environment := createNominalCamelTest(false)
        environment.CamelCatalog = nil
        environment.Integration.Status.RuntimeVersion = "Unmatchable version"
        environment.Integration.Status.RuntimeProvider = 
v1.RuntimeProviderQuarkus
@@ -79,15 +79,50 @@ func 
TestApplyCamelTraitWithoutEnvironmentCatalogAndUnmatchableVersionFails(t *t
        assert.Equal(t, "unable to find catalog matching version requirement: 
runtime=Unmatchable version, provider=quarkus", err.Error())
 }
 
-func createNominalCamelTest() (*camelTrait, *Environment) {
+func createNominalCamelTest(withSources bool) (*camelTrait, *Environment) {
        client, _ := test.NewFakeClient()
 
        trait, _ := newCamelTrait().(*camelTrait)
        trait.Enabled = pointer.Bool(true)
-
+       var sources []v1.SourceSpec
+       if withSources {
+               sources = []v1.SourceSpec{
+                       {
+                               DataSpec: v1.DataSpec{
+                                       Name:    "source1.java",
+                                       Content: "Java Source Code",
+                               },
+                               Type: "data",
+                       },
+                       {
+                               DataSpec: v1.DataSpec{
+                                       Name:    "source2.xml",
+                                       Content: "XML Source Code",
+                               },
+                               Type: "data",
+                       },
+                       {
+                               DataSpec: v1.DataSpec{
+                                       Name:       "source3.xml",
+                                       ContentRef: "my-cm1",
+                               },
+                               Type: "data",
+                       },
+               }
+       } else {
+               sources = []v1.SourceSpec{}
+       }
        environment := &Environment{
                CamelCatalog: &camel.RuntimeCatalog{
                        CamelCatalogSpec: v1.CamelCatalogSpec{
+                               Loaders: map[string]v1.CamelLoader{
+                                       "java": {
+                                               Metadata: map[string]string{
+                                                       "native":               
          "true",
+                                                       
"sources-required-at-build-time": "true",
+                                               },
+                                       },
+                               },
                                Runtime: v1.RuntimeSpec{
                                        Version:  "0.0.1",
                                        Provider: v1.RuntimeProviderQuarkus,
@@ -99,10 +134,12 @@ func createNominalCamelTest() (*camelTrait, *Environment) {
                Client:  client,
                Integration: &v1.Integration{
                        ObjectMeta: metav1.ObjectMeta{
+                               Name:      "some-integration",
                                Namespace: "namespace",
                        },
                        Spec: v1.IntegrationSpec{
-                               Traits: v1.Traits{},
+                               Traits:  v1.Traits{},
+                               Sources: sources,
                        },
                        Status: v1.IntegrationStatus{
                                RuntimeVersion: "0.0.1",
@@ -110,6 +147,12 @@ func createNominalCamelTest() (*camelTrait, *Environment) {
                        },
                },
                IntegrationKit: &v1.IntegrationKit{
+                       ObjectMeta: metav1.ObjectMeta{
+                               Labels: map[string]string{
+                                       v1.IntegrationKitLayoutLabel: 
v1.IntegrationKitLayoutNative,
+                               },
+                               Namespace: "namespace",
+                       },
                        Status: v1.IntegrationKitStatus{
                                Phase: v1.IntegrationKitPhaseReady,
                        },
@@ -127,7 +170,7 @@ func createNominalCamelTest() (*camelTrait, *Environment) {
 }
 
 func TestApplyCamelTraitWithProperties(t *testing.T) {
-       trait, environment := createNominalCamelTest()
+       trait, environment := createNominalCamelTest(false)
        trait.Properties = []string{"a=b", "c=d"}
 
        configured, err := trait.Configure(environment)
@@ -145,3 +188,23 @@ func TestApplyCamelTraitWithProperties(t *testing.T) {
                "application.properties": "a=b\nc=d\n",
        }, userPropertiesCm.Data)
 }
+
+func TestApplyCamelTraitWithSources(t *testing.T) {
+       trait, environment := createNominalCamelTest(true)
+
+       configured, err := trait.Configure(environment)
+       assert.Nil(t, err)
+       assert.True(t, configured)
+
+       err = trait.Apply(environment)
+       assert.Nil(t, err)
+
+       assert.Equal(t, 1, environment.Resources.Size())
+       sourceCm := environment.Resources.GetConfigMap(func(cm 
*corev1.ConfigMap) bool {
+               return cm.Name == "some-integration-source-001" && 
cm.Annotations["camel.apache.org/source.language"] == "xml" && 
cm.Annotations["camel.apache.org/source.name"] == "source2.xml"
+       })
+       assert.NotNil(t, sourceCm)
+       assert.Equal(t, map[string]string{
+               "content": "XML Source Code",
+       }, sourceCm.Data)
+}
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index ff3decb31..8187dbdac 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -32,6 +32,7 @@ import (
        "github.com/apache/camel-k/pkg/builder"
        "github.com/apache/camel-k/pkg/util/defaults"
        "github.com/apache/camel-k/pkg/util/kubernetes"
+       "github.com/apache/camel-k/pkg/util/log"
 )
 
 const (
@@ -47,6 +48,47 @@ type quarkusTrait struct {
        BaseTrait
        traitv1.QuarkusTrait `property:",squash"`
 }
+type languageSettings struct {
+       // indicates whether the native mode is supported
+       native bool
+       // indicates whether the sources are required at build time for native 
compilation
+       sourcesRequiredAtBuildTime bool
+}
+
+var (
+       // settings for an unknown language.
+       defaultSettings = languageSettings{false, false}
+       // settings for languages supporting native mode for old catalogs.
+       nativeSupportSettings = languageSettings{true, false}
+)
+
+// Retrieves the settings of the given language from the Camel catalog.
+func getLanguageSettings(e *Environment, language v1.Language) 
languageSettings {
+       if loader, ok := e.CamelCatalog.Loaders[string(language)]; ok {
+               native, nExists := loader.Metadata["native"]
+               if !nExists {
+                       log.Debug("The metadata 'native' is absent from the 
Camel catalog, the legacy language settings are applied")
+                       return getLegacyLanguageSettings(language)
+               }
+               sourcesRequiredAtBuildTime, sExists := 
loader.Metadata["sources-required-at-build-time"]
+               return languageSettings{
+                       native:                     native == "true",
+                       sourcesRequiredAtBuildTime: sExists && 
sourcesRequiredAtBuildTime == "true",
+               }
+       }
+       log.Debugf("No loader could be found for the language %q, the legacy 
language settings are applied", string(language))
+       return getLegacyLanguageSettings(language)
+}
+
+// Provides the legacy settings of a given language.
+func getLegacyLanguageSettings(language v1.Language) languageSettings {
+       switch language {
+       case v1.LanguageXML, v1.LanguageYaml, v1.LanguageKamelet:
+               return nativeSupportSettings
+       default:
+               return defaultSettings
+       }
+}
 
 func newQuarkusTrait() Trait {
        return &quarkusTrait{
@@ -161,9 +203,7 @@ func (t *quarkusTrait) applyWhileBuildingKit(e 
*Environment) {
 
 func (t *quarkusTrait) validateNativeSupport(e *Environment) bool {
        for _, source := range e.Integration.Sources() {
-               if language := source.InferLanguage(); language != 
v1.LanguageKamelet &&
-                       language != v1.LanguageYaml &&
-                       language != v1.LanguageXML {
+               if language := source.InferLanguage(); !getLanguageSettings(e, 
language).native {
                        t.L.ForIntegration(e.Integration).Infof("Integration 
%s/%s contains a %s source that cannot be compiled to native executable", 
e.Integration.Namespace, e.Integration.Name, language)
                        e.Integration.Status.Phase = v1.IntegrationPhaseError
                        e.Integration.Status.SetCondition(
@@ -216,6 +256,9 @@ func (t *quarkusTrait) newIntegrationKit(e *Environment, 
packageType traitv1.Qua
                Traits:       propagateKitTraits(e),
        }
 
+       if packageType == traitv1.NativePackageType {
+               kit.Spec.Sources = propagateSourcesRequiredAtBuildTime(e)
+       }
        return kit
 }
 
@@ -265,6 +308,10 @@ func (t *quarkusTrait) applyWhenBuildSubmitted(e 
*Environment) error {
 
        if native {
                build.Maven.Properties["quarkus.package.type"] = 
string(traitv1.NativePackageType)
+               if len(e.IntegrationKit.Spec.Sources) > 0 {
+                       build.Sources = e.IntegrationKit.Spec.Sources
+                       steps = append(steps, 
builder.Quarkus.PrepareProjectWithSources)
+               }
                steps = append(steps, builder.Image.NativeImageContext)
                // Spectrum does not rely on Dockerfile to assemble the image
                if e.Platform.Status.Build.PublishStrategy != 
v1.IntegrationPlatformBuildPublishStrategySpectrum {
@@ -319,6 +366,17 @@ func (t *quarkusTrait) isNativeIntegration(e *Environment) 
bool {
        return e.IntegrationKit.Labels[v1.IntegrationKitLayoutLabel] == 
v1.IntegrationKitLayoutNative
 }
 
+// Indicates whether the given source code is embedded into the final binary.
+func (t *quarkusTrait) isEmbedded(e *Environment, source v1.SourceSpec) bool {
+       if e.IntegrationInRunningPhases() {
+               return e.IntegrationKit != nil && t.isNativeIntegration(e) && 
sourcesRequiredAtBuildTime(e, source)
+       } else if e.IntegrationKitInPhase(v1.IntegrationKitPhaseBuildSubmitted) 
{
+               native, _ := t.isNativeKit(e)
+               return native && sourcesRequiredAtBuildTime(e, source)
+       }
+       return false
+}
+
 func containsPackageType(types []traitv1.QuarkusPackageType, t 
traitv1.QuarkusPackageType) bool {
        for _, ti := range types {
                if t == ti {
@@ -327,3 +385,20 @@ func containsPackageType(types 
[]traitv1.QuarkusPackageType, t traitv1.QuarkusPa
        }
        return false
 }
+
+// Indicates whether the given source file is required at build time for 
native compilation.
+func sourcesRequiredAtBuildTime(e *Environment, source v1.SourceSpec) bool {
+       settings := getLanguageSettings(e, source.InferLanguage())
+       return settings.native && settings.sourcesRequiredAtBuildTime
+}
+
+// Propagates the sources that are required at build time for native 
compilation.
+func propagateSourcesRequiredAtBuildTime(e *Environment) []v1.SourceSpec {
+       array := make([]v1.SourceSpec, 0)
+       for _, source := range e.Integration.Sources() {
+               if sourcesRequiredAtBuildTime(e, source) {
+                       array = append(array, source)
+               }
+       }
+       return array
+}
diff --git a/pkg/trait/quarkus_test.go b/pkg/trait/quarkus_test.go
index ef9b587fd..3e2a2faee 100644
--- a/pkg/trait/quarkus_test.go
+++ b/pkg/trait/quarkus_test.go
@@ -115,3 +115,93 @@ func createNominalQuarkusTest() (*quarkusTrait, 
*Environment) {
 
        return trait, environment
 }
+
+func TestGetLanguageSettingsWithoutLoaders(t *testing.T) {
+       environment := &Environment{
+               CamelCatalog: &camel.RuntimeCatalog{
+                       CamelCatalogSpec: v1.CamelCatalogSpec{
+                               Loaders: map[string]v1.CamelLoader{},
+                       },
+               },
+       }
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageJavaSource))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageGroovy))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageJavaScript))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageKotlin))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageJavaShell))
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageKamelet))
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageXML))
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageYaml))
+}
+
+func TestGetLanguageSettingsWithoutMetadata(t *testing.T) {
+       environment := &Environment{
+               CamelCatalog: &camel.RuntimeCatalog{
+                       CamelCatalogSpec: v1.CamelCatalogSpec{
+                               Loaders: map[string]v1.CamelLoader{
+                                       "java":    {},
+                                       "groovy":  {},
+                                       "js":      {},
+                                       "kts":     {},
+                                       "jsh":     {},
+                                       "kamelet": {},
+                                       "xml":     {},
+                                       "yaml":    {},
+                               },
+                       },
+               },
+       }
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageJavaSource))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageGroovy))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageJavaScript))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageKotlin))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageJavaShell))
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageKamelet))
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageXML))
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageYaml))
+}
+
+func TestGetLanguageSettingsWithLoaders(t *testing.T) {
+       environment := &Environment{
+               CamelCatalog: &camel.RuntimeCatalog{
+                       CamelCatalogSpec: v1.CamelCatalogSpec{
+                               Loaders: map[string]v1.CamelLoader{
+                                       "java": {
+                                               Metadata: map[string]string{
+                                                       "native":               
          "true",
+                                                       
"sources-required-at-build-time": "true",
+                                               },
+                                       },
+                                       "groovy": {
+                                               Metadata: map[string]string{
+                                                       "native":               
          "false",
+                                                       
"sources-required-at-build-time": "false",
+                                               },
+                                       },
+                                       "js": {
+                                               Metadata: map[string]string{
+                                                       "native":               
          "true",
+                                                       
"sources-required-at-build-time": "false",
+                                               },
+                                       },
+                                       "kts": {
+                                               Metadata: map[string]string{
+                                                       "native":               
          "false",
+                                                       
"sources-required-at-build-time": "true",
+                                               },
+                                       },
+                                       "jsh": {
+                                               Metadata: map[string]string{
+                                                       "native": "true",
+                                               },
+                                       },
+                               },
+                       },
+               },
+       }
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: true}, getLanguageSettings(environment, 
v1.LanguageJavaSource))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageGroovy))
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageJavaScript))
+       assert.Equal(t, languageSettings{native: false, 
sourcesRequiredAtBuildTime: true}, getLanguageSettings(environment, 
v1.LanguageKotlin))
+       assert.Equal(t, languageSettings{native: true, 
sourcesRequiredAtBuildTime: false}, getLanguageSettings(environment, 
v1.LanguageJavaShell))
+}
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index 63fcb07d0..837cc3c42 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -283,6 +283,7 @@ func TestConfigureVolumesAndMountsSources(t *testing.T) {
                                },
                        },
                },
+               Catalog: &Catalog{},
        }
 
        vols := make([]corev1.Volume, 0)
@@ -312,6 +313,109 @@ func TestConfigureVolumesAndMountsSources(t *testing.T) {
        assert.NotNil(t, m)
 }
 
+func TestConfigureVolumesAndMountsSourcesInNativeMode(t *testing.T) {
+       traitList := make([]Trait, 0, len(FactoryList))
+       trait, ok := newQuarkusTrait().(*quarkusTrait)
+       assert.True(t, ok, "A Quarkus trait was expected")
+       trait.PackageTypes = 
[]traitv1.QuarkusPackageType{traitv1.NativePackageType}
+       traitList = append(traitList, trait)
+       env := Environment{
+               Resources: kubernetes.NewCollection(),
+               Integration: &v1.Integration{
+                       ObjectMeta: metav1.ObjectMeta{
+                               Name:      TestDeploymentName,
+                               Namespace: "ns",
+                       },
+                       Spec: v1.IntegrationSpec{
+                               Sources: []v1.SourceSpec{
+                                       {
+                                               DataSpec: v1.DataSpec{
+                                                       Name:       
"source1.xml",
+                                                       ContentRef: "my-cm1",
+                                                       ContentKey: 
"source1.xml",
+                                               },
+                                               Type: "data",
+                                       },
+                                       {
+                                               DataSpec: v1.DataSpec{
+                                                       Name:       
"source2.java",
+                                                       ContentRef: "my-cm2",
+                                               },
+                                               Type: "data",
+                                       },
+                                       {
+                                               DataSpec: v1.DataSpec{
+                                                       Name:       
"source1.java",
+                                                       ContentRef: "my-cm3",
+                                                       ContentKey: 
"source1.java",
+                                               },
+                                               Type: "data",
+                                       },
+                                       {
+                                               DataSpec: v1.DataSpec{
+                                                       Name:       
"source2.xml",
+                                                       ContentRef: "my-cm4",
+                                               },
+                                               Type: "data",
+                                       },
+                               },
+                       },
+                       Status: v1.IntegrationStatus{
+                               Phase: v1.IntegrationPhaseRunning,
+                       },
+               },
+               IntegrationKit: &v1.IntegrationKit{
+                       ObjectMeta: metav1.ObjectMeta{
+                               Labels: map[string]string{
+                                       v1.IntegrationKitLayoutLabel: 
v1.IntegrationKitLayoutNative,
+                               },
+                               Namespace: "ns",
+                       },
+               },
+               Catalog: &Catalog{
+                       traits: traitList,
+               },
+               CamelCatalog: &camel.RuntimeCatalog{
+                       CamelCatalogSpec: v1.CamelCatalogSpec{
+                               Loaders: map[string]v1.CamelLoader{
+                                       "java": {
+                                               Metadata: map[string]string{
+                                                       "native":               
          "true",
+                                                       
"sources-required-at-build-time": "true",
+                                               },
+                                       },
+                               },
+                       },
+               },
+       }
+
+       vols := make([]corev1.Volume, 0)
+       mnts := make([]corev1.VolumeMount, 0)
+
+       env.configureVolumesAndMounts(&vols, &mnts)
+
+       assert.Len(t, vols, 2)
+       assert.Len(t, mnts, 2)
+
+       v := findVolume(vols, func(v corev1.Volume) bool { return 
v.ConfigMap.Name == "my-cm1" })
+       assert.NotNil(t, v)
+       assert.NotNil(t, v.VolumeSource.ConfigMap)
+       assert.Len(t, v.VolumeSource.ConfigMap.Items, 1)
+       assert.Equal(t, "source1.xml", v.VolumeSource.ConfigMap.Items[0].Key)
+
+       m := findVVolumeMount(mnts, func(m corev1.VolumeMount) bool { return 
m.Name == v.Name })
+       assert.NotNil(t, m)
+
+       v = findVolume(vols, func(v corev1.Volume) bool { return 
v.ConfigMap.Name == "my-cm4" })
+       assert.NotNil(t, v)
+       assert.NotNil(t, v.VolumeSource.ConfigMap)
+       assert.Len(t, v.VolumeSource.ConfigMap.Items, 1)
+       assert.Equal(t, "content", v.VolumeSource.ConfigMap.Items[0].Key)
+
+       m = findVVolumeMount(mnts, func(m corev1.VolumeMount) bool { return 
m.Name == v.Name })
+       assert.NotNil(t, m)
+}
+
 func TestOnlySomeTraitsInfluenceBuild(t *testing.T) {
        c := NewTraitTestCatalog()
        buildTraits := []string{"builder", "camel", "quarkus", "registry"}
diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go
index b38b9a7d8..f32714d70 100644
--- a/pkg/trait/trait_types.go
+++ b/pkg/trait/trait_types.go
@@ -405,32 +405,36 @@ func (e *Environment) addSourcesProperties() {
        if e.ApplicationProperties == nil {
                e.ApplicationProperties = make(map[string]string)
        }
-       for i, s := range e.Integration.Sources() {
+       idx := 0
+       for _, s := range e.Integration.Sources() {
+               if e.isEmbedded(s) {
+                       continue
+               }
                srcName := strings.TrimPrefix(filepath.ToSlash(s.Name), "/")
                src := "file:" + 
path.Join(filepath.ToSlash(camel.SourcesMountPath), srcName)
-               
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].location", i)] = src
+               
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].location", idx)] = src
 
                simpleName := srcName
                if strings.Contains(srcName, ".") {
                        simpleName = srcName[0:strings.Index(srcName, ".")]
                }
-               e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].name", 
i)] = simpleName
+               e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].name", 
idx)] = simpleName
 
                for pid, p := range s.PropertyNames {
-                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].property-names[%d]", 
i, pid)] = p
+                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].property-names[%d]", 
idx, pid)] = p
                }
 
                if s.Type != "" {
-                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].type", i)] = 
string(s.Type)
+                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].type", idx)] = 
string(s.Type)
                }
                if s.InferLanguage() != "" {
-                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].language", i)] = 
string(s.InferLanguage())
+                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].language", idx)] = 
string(s.InferLanguage())
                }
                if s.Loader != "" {
-                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].loader", i)] = s.Loader
+                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].loader", idx)] = 
s.Loader
                }
                if s.Compression {
-                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].compressed", i)] = 
"true"
+                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].compressed", idx)] = 
"true"
                }
 
                interceptors := make([]string, 0, len(s.Interceptors))
@@ -441,8 +445,9 @@ func (e *Environment) addSourcesProperties() {
                        interceptors = append(interceptors, e.Interceptors...)
                }
                for intID, interceptor := range interceptors {
-                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].interceptors[%d]", i, 
intID)] = interceptor
+                       
e.ApplicationProperties[fmt.Sprintf("camel.k.sources[%d].interceptors[%d]", 
idx, intID)] = interceptor
                }
+               idx++
        }
 }
 
@@ -450,8 +455,12 @@ func (e *Environment) configureVolumesAndMounts(vols 
*[]corev1.Volume, mnts *[]c
        //
        // Volumes :: Sources
        //
-       for i, s := range e.Integration.Sources() {
-               cmName := fmt.Sprintf("%s-source-%03d", e.Integration.Name, i)
+       idx := 0
+       for _, s := range e.Integration.Sources() {
+               if e.isEmbedded(s) {
+                       continue
+               }
+               cmName := fmt.Sprintf("%s-source-%03d", e.Integration.Name, idx)
                if s.ContentRef != "" {
                        cmName = s.ContentRef
                }
@@ -460,13 +469,14 @@ func (e *Environment) configureVolumesAndMounts(vols 
*[]corev1.Volume, mnts *[]c
                        cmKey = s.ContentKey
                }
                resName := strings.TrimPrefix(s.Name, "/")
-               refName := fmt.Sprintf("i-source-%03d", i)
+               refName := fmt.Sprintf("i-source-%03d", idx)
                resPath := filepath.Join(camel.SourcesMountPath, resName)
                vol := getVolume(refName, "configmap", cmName, cmKey, resName)
                mnt := getMount(refName, resPath, resName, true)
 
                *vols = append(*vols, *vol)
                *mnts = append(*mnts, *mnt)
+               idx++
        }
 
        if e.Resources != nil {
@@ -651,6 +661,16 @@ func (e *Environment) GetIntegrationContainerName() string 
{
        return containerName
 }
 
+// Indicates whether the given source is embedded in the final binary.
+func (e *Environment) isEmbedded(source v1.SourceSpec) bool {
+       if dt := e.Catalog.GetTrait(quarkusTraitID); dt != nil {
+               if qt, ok := dt.(*quarkusTrait); ok {
+                       return qt.isEmbedded(e, source)
+               }
+       }
+       return false
+}
+
 func (e *Environment) GetIntegrationContainer() *corev1.Container {
        containerName := e.GetIntegrationContainerName()
        return e.Resources.GetContainerByName(containerName)
diff --git a/pkg/util/source/inspector.go b/pkg/util/source/inspector.go
index 33fa7b2b7..7be1eaf54 100644
--- a/pkg/util/source/inspector.go
+++ b/pkg/util/source/inspector.go
@@ -207,6 +207,12 @@ func InspectorForLanguage(catalog *camel.RuntimeCatalog, 
language v1.Language) I
                                catalog: catalog,
                        },
                }
+       case v1.LanguageJavaShell:
+               return &JavaSourceInspector{
+                       baseInspector: baseInspector{
+                               catalog: catalog,
+                       },
+               }
        }
        return &baseInspector{}
 }
diff --git a/resources/traits.yaml b/resources/traits.yaml
index 05c383ad8..697d8c523 100755
--- a/resources/traits.yaml
+++ b/resources/traits.yaml
@@ -1216,7 +1216,6 @@ traits:
   - OpenShift
   description: 'The Quarkus trait configures the Quarkus runtime. It''s 
enabled by
     default. NOTE: Compiling to a native executable, i.e. when using 
`package-type=native`,
-    is only supported for kamelets, as well as YAML and XML integrations. It 
also
     requires at least 4GiB of memory, so the Pod running the native build, 
that is
     either the operator Pod, or the build Pod (depending on the build strategy 
configured
     for the platform), must have enough memory available.'
diff --git a/script/Makefile b/script/Makefile
index 0dcda1015..3e0f88ac6 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -321,6 +321,10 @@ test-quarkus-native: do-build
        STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
        go test -timeout 180m -v ./e2e/namespace/native -tags=integration 
$(TEST_QUARKUS_RUN) -json 2>&1 | gotestfmt
 
+test-quarkus-native-high-memory: do-build
+       STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
+       go test -timeout 180m -v ./e2e/namespace/native 
-tags=integration,high_memory $(TEST_QUARKUS_RUN) -json 2>&1 | gotestfmt
+
 test-upgrade: do-build
        STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
        go test -timeout 90m -v ./e2e/namespace/upgrade -tags=integration 
$(TEST_UPGRADE_RUN) -json 2>&1 | gotestfmt


Reply via email to