Upgrade karaf to version 4.2.14

Change-Id: Ibfa72941a01fb8026513d39f5b3d5f2bb3dcc9d2
diff --git a/tools/build/bazel/generate_workspace.bzl b/tools/build/bazel/generate_workspace.bzl
index 55c35c7..5ebcd10 100644
--- a/tools/build/bazel/generate_workspace.bzl
+++ b/tools/build/bazel/generate_workspace.bzl
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Tue, 30 Mar 2021 16:02:11 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Thu, 6 Jan 2022 08:36:09 GMT. Do not edit this file manually. *****
 # ***** Use onos-lib-gen *****
 
 load("//tools/build/bazel:variables.bzl", "ONOS_GROUP_ID", "ONOS_VERSION")
@@ -871,27 +871,27 @@
     if "org_apache_karaf_bundle_core" not in native.existing_rules():
         java_import_external(
             name = "org_apache_karaf_bundle_core",
-            jar_sha256 = "1b494b5c596e1b5fe81136c69a7b0e3ad8e86134207c46bf4cbb029b5414aaf8",
+            jar_sha256 = "e4b1d099c21c03308855055c9df9993fbdba826d4b5301a5fb75f9d194fbef93",
             licenses = ["notice"],
-            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/bundle/org.apache.karaf.bundle.core/4.2.9/org.apache.karaf.bundle.core-4.2.9.jar"],        )
+            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/bundle/org.apache.karaf.bundle.core/4.2.14/org.apache.karaf.bundle.core-4.2.14.jar"],        )
     if "org_apache_karaf_features_core" not in native.existing_rules():
         java_import_external(
             name = "org_apache_karaf_features_core",
-            jar_sha256 = "0b9baf7a41e95d184f26d59cd923431900699b6bf55e09b883300d43fa97aa18",
+            jar_sha256 = "98273471d25ad9b01c8d2bee22c99f01f5f0763aed66d0fc79a1910ab0faf3b9",
             licenses = ["notice"],
-            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/features/org.apache.karaf.features.core/4.2.9/org.apache.karaf.features.core-4.2.9.jar"],        )
+            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/features/org.apache.karaf.features.core/4.2.14/org.apache.karaf.features.core-4.2.14.jar"],        )
     if "org_apache_karaf_shell_console" not in native.existing_rules():
         java_import_external(
             name = "org_apache_karaf_shell_console",
-            jar_sha256 = "8bb60748f6bf6498b8f2c13cf96919e6f8c361af97d9a373eade474841e85196",
+            jar_sha256 = "08bcab878989aec2ef352aebe99d6a03e490fd76cb6dbe43208a3eec78f3dcee",
             licenses = ["notice"],
-            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/shell/org.apache.karaf.shell.console/4.2.9/org.apache.karaf.shell.console-4.2.9.jar"],        )
+            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/shell/org.apache.karaf.shell.console/4.2.14/org.apache.karaf.shell.console-4.2.14.jar"],        )
     if "org_apache_karaf_shell_core" not in native.existing_rules():
         java_import_external(
             name = "org_apache_karaf_shell_core",
-            jar_sha256 = "2b39bfcc5972271f697894364d7937a72317962248b6a6734614f656cb840459",
+            jar_sha256 = "e769595061487eeb143c298f4d01272cfc3f78ef6ef8c5e49ff8b0689a647e99",
             licenses = ["notice"],
-            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/shell/org.apache.karaf.shell.core/4.2.9/org.apache.karaf.shell.core-4.2.9.jar"],        )
+            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/shell/org.apache.karaf.shell.core/4.2.14/org.apache.karaf.shell.core-4.2.14.jar"],        )
     if "org_apache_httpcomponents_httpasyncclient_osgi" not in native.existing_rules():
         java_import_external(
             name = "org_apache_httpcomponents_httpasyncclient_osgi",
@@ -907,15 +907,15 @@
     if "org_apache_karaf_jaas" not in native.existing_rules():
         java_import_external(
             name = "org_apache_karaf_jaas",
-            jar_sha256 = "a24b744898d9d1bafcd0c094270652896d1e4e4ebaacb35b638dd46b93e5c600",
+            jar_sha256 = "3434034496ee96593cb13c9461380f88c6868f3797b45464c931ff02441dc225",
             licenses = ["notice"],
-            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/jaas/org.apache.karaf.jaas.modules/4.2.9/org.apache.karaf.jaas.modules-4.2.9.jar"],        )
+            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/jaas/org.apache.karaf.jaas.modules/4.2.14/org.apache.karaf.jaas.modules-4.2.14.jar"],        )
     if "org_apache_karaf_system_core" not in native.existing_rules():
         java_import_external(
             name = "org_apache_karaf_system_core",
-            jar_sha256 = "34d1f8057b7d2226cbd1a5219454d038c1799995e9ac9626baa35e284ddfa238",
+            jar_sha256 = "307ce836799a81562b9d181d89a049aebeae7c2961d1cb4feabf2b7f1165aaef",
             licenses = ["notice"],
-            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/system/org.apache.karaf.system.core/4.2.9/org.apache.karaf.system.core-4.2.9.jar"],        )
+            jar_urls = ["https://repo1.maven.org/maven2/org/apache/karaf/system/org.apache.karaf.system.core/4.2.14/org.apache.karaf.system.core-4.2.14.jar"],        )
     if "org_apache_servicemix_bundles_snmp4j" not in native.existing_rules():
         java_import_external(
             name = "org_apache_servicemix_bundles_snmp4j",
@@ -1009,9 +1009,9 @@
     if "apache_karaf" not in native.existing_rules():
         java_import_external(
             name = "apache_karaf",
-            jar_sha256 = "ad1c15da75d9112537df09bef1e9fcadb11446619f38a22105592a9273061bf4",
+            jar_sha256 = "892241ce4b48406e7f66d6a4e40bfb039a2dfbf88760e6ff8a62a7df680bcaf9",
             licenses = ["notice"],
-            jar_urls = ["https://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/4.2.9-offline-20200706/apache-karaf-4.2.9-offline-20200706.tar.gz"],        )
+            jar_urls = ["https://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/4.2.14-offline-20220105/apache-karaf-4.2.14-offline-20220105.tar.gz"],        )
     if "bndlib" not in native.existing_rules():
         java_import_external(
             name = "bndlib",
@@ -1467,14 +1467,14 @@
 artifact_map["@org_osgi_service_metatype_annotations//:org_osgi_service_metatype_annotations"] = "mvn:org.osgi:org.osgi.service.metatype.annotations:jar:1.4.0"
 artifact_map["@org_osgi_service_cm//:org_osgi_service_cm"] = "mvn:org.osgi:org.osgi.service.cm:jar:1.6.0"
 artifact_map["@org_apache_felix_scr_bnd//:org_apache_felix_scr_bnd"] = "mvn:org.apache.felix:org.apache.felix.scr.bnd:jar:NON-OSGI:1.9.0"
-artifact_map["@org_apache_karaf_bundle_core//:org_apache_karaf_bundle_core"] = "mvn:org.apache.karaf.bundle:org.apache.karaf.bundle.core:jar:4.2.9"
-artifact_map["@org_apache_karaf_features_core//:org_apache_karaf_features_core"] = "mvn:org.apache.karaf.features:org.apache.karaf.features.core:jar:4.2.9"
-artifact_map["@org_apache_karaf_shell_console//:org_apache_karaf_shell_console"] = "mvn:org.apache.karaf.shell:org.apache.karaf.shell.console:jar:4.2.9"
-artifact_map["@org_apache_karaf_shell_core//:org_apache_karaf_shell_core"] = "mvn:org.apache.karaf.shell:org.apache.karaf.shell.core:jar:4.2.9"
+artifact_map["@org_apache_karaf_bundle_core//:org_apache_karaf_bundle_core"] = "mvn:org.apache.karaf.bundle:org.apache.karaf.bundle.core:jar:4.2.14"
+artifact_map["@org_apache_karaf_features_core//:org_apache_karaf_features_core"] = "mvn:org.apache.karaf.features:org.apache.karaf.features.core:jar:4.2.14"
+artifact_map["@org_apache_karaf_shell_console//:org_apache_karaf_shell_console"] = "mvn:org.apache.karaf.shell:org.apache.karaf.shell.console:jar:4.2.14"
+artifact_map["@org_apache_karaf_shell_core//:org_apache_karaf_shell_core"] = "mvn:org.apache.karaf.shell:org.apache.karaf.shell.core:jar:4.2.14"
 artifact_map["@org_apache_httpcomponents_httpasyncclient_osgi//:org_apache_httpcomponents_httpasyncclient_osgi"] = "mvn:org.apache.httpcomponents:httpasyncclient-osgi:jar:4.1.2"
 artifact_map["@org_apache_httpcomponents_httpcore_nio//:org_apache_httpcomponents_httpcore_nio"] = "mvn:org.apache.httpcomponents:httpcore-nio:jar:NON-OSGI:4.4.4"
-artifact_map["@org_apache_karaf_jaas//:org_apache_karaf_jaas"] = "mvn:org.apache.karaf.jaas:org.apache.karaf.jaas.modules:jar:4.2.9"
-artifact_map["@org_apache_karaf_system_core//:org_apache_karaf_system_core"] = "mvn:org.apache.karaf.system:org.apache.karaf.system.core:jar:4.2.9"
+artifact_map["@org_apache_karaf_jaas//:org_apache_karaf_jaas"] = "mvn:org.apache.karaf.jaas:org.apache.karaf.jaas.modules:jar:4.2.14"
+artifact_map["@org_apache_karaf_system_core//:org_apache_karaf_system_core"] = "mvn:org.apache.karaf.system:org.apache.karaf.system.core:jar:4.2.14"
 artifact_map["@org_apache_servicemix_bundles_snmp4j//:org_apache_servicemix_bundles_snmp4j"] = "mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.snmp4j:jar:2.3.4_1"
 artifact_map["@org_osgi_cmpn//:org_osgi_cmpn"] = "mvn:org.osgi:osgi.cmpn:jar:6.0.0"
 artifact_map["@osgi_core//:osgi_core"] = "mvn:org.osgi:org.osgi.core:jar:6.0.0"
@@ -1490,7 +1490,7 @@
 artifact_map["@typesafe_config//:typesafe_config"] = "mvn:com.typesafe:config:jar:1.3.2"
 artifact_map["@validation_api//:validation_api"] = "mvn:javax.validation:validation-api:jar:2.0.1.Final"
 artifact_map["@checkstyle//:checkstyle"] = "mvn:com.puppycrawl.tools:checkstyle:jar:NON-OSGI:8.10"
-artifact_map["@apache_karaf//:apache_karaf"] = "https://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/4.2.9-offline-20200706/apache-karaf-4.2.9-offline-20200706.tar.gz"
+artifact_map["@apache_karaf//:apache_karaf"] = "https://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/4.2.14-offline-20220105/apache-karaf-4.2.14-offline-20220105.tar.gz"
 artifact_map["@bndlib//:bndlib"] = "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:4.1.0"
 artifact_map["@bndexe//:bndexe"] = "mvn:biz.aQute.bnd:biz.aQute.bnd:jar:4.1.0"
 artifact_map["@libthrift//:libthrift"] = "mvn:org.apache.thrift:libthrift:jar:0.11.0"
diff --git a/tools/build/bazel/osgi_features.bzl b/tools/build/bazel/osgi_features.bzl
index a156189..e83df68 100644
--- a/tools/build/bazel/osgi_features.bzl
+++ b/tools/build/bazel/osgi_features.bzl
@@ -102,7 +102,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
           name="onos-%s">
-    <repository>mvn:org.apache.karaf.features/standard/4.2.9/xml/features</repository>
+    <repository>mvn:org.apache.karaf.features/standard/4.2.14/xml/features</repository>
 ''' % ONOS_VERSION
 
 FEATURES_FOOTER = "</features>"
diff --git a/tools/build/build-offline-karaf b/tools/build/build-offline-karaf
index 3563c49..f5aa560 100755
--- a/tools/build/build-offline-karaf
+++ b/tools/build/build-offline-karaf
@@ -1,7 +1,6 @@
 #!/bin/bash
 
-KARAF_RELEASE_VERSION="4.2.9"
-KARAF_BASE_PACKAGE_VERSION="4.2.9"
+KARAF_BASE_PACKAGE_VERSION="$KARAF_RELEASE_VERSION"
 KARAF_TARFILE_NAME="apache-karaf-${KARAF_RELEASE_VERSION}.tar"
 ADDED_BOOT_FEATURES="kar/${KARAF_RELEASE_VERSION},webconsole/${KARAF_RELEASE_VERSION},scr/${KARAF_RELEASE_VERSION},war/${KARAF_RELEASE_VERSION}"
 
@@ -9,13 +8,14 @@
 rm -f /tmp/${KARAF_TARFILE_NAME}
 curl -o /tmp/${KARAF_TARFILE_NAME}.gz https://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/${KARAF_BASE_PACKAGE_VERSION}/apache-karaf-${KARAF_BASE_PACKAGE_VERSION}.tar.gz
 
-# get a small cell
 source ${ONOS_ROOT}/tools/dev/bash_profile
-cell borrow 60 1+0
 scp /tmp/${KARAF_TARFILE_NAME}.gz sdn@[${OC1}]:/tmp/${KARAF_TARFILE_NAME}.gz
 
 ssh sdn@${OC1} "
 
+    # clear out the existing maven cache
+    rm -rf ~/.m2/repository
+
     # unroll the base karaf
     rm -rf karaf
     mkdir karaf
@@ -53,9 +53,8 @@
 
 # fetch the new offline karaf tar ball
 BUILD_NUMBER="${KARAF_RELEASE_VERSION}-offline-$(date +'%Y%m%d')"
-scp sdn@[${OC1}]:karaf-offline.tar.gz /tmp/${BUILD_NUMBER}.tar.gz
+scp sdn@[${OC1}]:karaf-offline.tar.gz ./apache-karaf-${BUILD_NUMBER}.tar.gz
 
-cell return
 
 
 
diff --git a/tools/build/envDefaults b/tools/build/envDefaults
index 791a711..dc47fb8 100644
--- a/tools/build/envDefaults
+++ b/tools/build/envDefaults
@@ -5,7 +5,7 @@
 
 # M2 repository and Karaf gold bits
 export M2_REPO=${M2_REPO:-~/.m2/repository}
-export KARAF_VERSION=4.2.9
+export KARAF_VERSION=4.2.14
 export KARAF_ZIP=${KARAF_ZIP:-~/Downloads/apache-karaf-$KARAF_VERSION.zip}
 export KARAF_TAR=${KARAF_TAR:-~/Downloads/apache-karaf-$KARAF_VERSION.tar.gz}
 export KARAF_DIST=$(basename $KARAF_ZIP .zip)
diff --git a/tools/build/push-karaf b/tools/build/push-karaf
new file mode 100755
index 0000000..7d74a74
--- /dev/null
+++ b/tools/build/push-karaf
@@ -0,0 +1,50 @@
+#!/bin/bash
+# Copyright 2020-present Open Networking Foundation.
+#
+# Licensed 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.
+
+set -eu -o pipefail
+
+if [ $# != 2 ]; then
+   echo Usage: push-karaf version directory
+   exit 1
+fi
+
+PLUGIN_VERSION=$1
+DIRECTORY=$2
+SONATYPE_USER=${SONATYPE_USER:-""}
+SONATYPE_PASSWORD=${SONATYPE_PASSWORD:-""}
+
+if [ "$SONATYPE_USER" == "" -o "$SONATYPE_PASSWORD" == "" ]; then
+   echo SONATYPE_USER and SONATYPE_PASSWORD must be set
+   exit 1
+fi
+
+PLUGIN_FILE="$DIRECTORY/apache-karaf-${PLUGIN_VERSION}.tar.gz"
+BASE_ARTIFACT_NAME="apache-karaf"
+
+UPLOAD_BASE="https://oss.sonatype.org/service/local/staging/deploy/maven2/org/onosproject/apache-karaf-offline/$PLUGIN_VERSION"
+
+# Make the signature file
+gpg --armor --detach-sig $PLUGIN_FILE
+
+# Make the MD5 checksum file
+md5 -q $PLUGIN_FILE >$PLUGIN_FILE.md5
+
+# Make the SHA1 checksum file
+( shasum $PLUGIN_FILE | cut -d' ' -f1 ) > $PLUGIN_FILE.sha1
+
+curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE $UPLOAD_BASE/$BASE_ARTIFACT_NAME-$PLUGIN_VERSION.tar.gz
+curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.asc $UPLOAD_BASE/$BASE_ARTIFACT_NAME-$PLUGIN_VERSION.tar.gz.asc
+curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.md5 $UPLOAD_BASE/$BASE_ARTIFACT_NAME-$PLUGIN_VERSION.tar.gz.md5
+curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.sha1 $UPLOAD_BASE/$BASE_ARTIFACT_NAME-$PLUGIN_VERSION.tar.gz.sha1
diff --git a/tools/package/bin/onos-backup b/tools/package/bin/onos-backup
index 6a1af04..3def645 100755
--- a/tools/package/bin/onos-backup
+++ b/tools/package/bin/onos-backup
@@ -5,7 +5,7 @@
 
 ONOS_HOME=${ONOS_HOME:-$(cd $(dirname $0)/.. >/dev/null 2>&1 && pwd)}
 ONOS_DEFAULT_ARCHIVE=$(dirname $ONOS_HOME)/onos-data.tar.gz
-ONOS_KARAF=$ONOS_HOME/apache-karaf-4.2.9
+ONOS_KARAF=$ONOS_HOME/apache-karaf-4.2.14
 
 # Fetch the name of the archive or use a default if none is specified
 archive=${1:-$ONOS_DEFAULT_ARCHIVE}
diff --git a/tools/package/bin/onos-restore b/tools/package/bin/onos-restore
index 7900327..987b1b4 100755
--- a/tools/package/bin/onos-restore
+++ b/tools/package/bin/onos-restore
@@ -5,7 +5,7 @@
 
 ONOS_HOME=${ONOS_HOME:-$(cd $(dirname $0)/.. >/dev/null 2>&1 && pwd)}
 ONOS_DEFAULT_ARCHIVE=$(dirname $ONOS_HOME)/onos-data.tar.gz
-ONOS_KARAF=$ONOS_HOME/apache-karaf-4.2.9
+ONOS_KARAF=$ONOS_HOME/apache-karaf-4.2.14
 
 # Fetch the name of the archive or use a default if none is specified
 archive=${1:-$ONOS_DEFAULT_ARCHIVE}
diff --git a/tools/package/dependencies/template.pom b/tools/package/dependencies/template.pom
index 618f6fd..e0a94b0 100644
--- a/tools/package/dependencies/template.pom
+++ b/tools/package/dependencies/template.pom
@@ -33,7 +33,7 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <karaf.version>4.2.9</karaf.version>
+        <karaf.version>4.2.14</karaf.version>
         <maven.version.min>3.3.9</maven.version.min>
         <java.version.min><!-- JAVA_VERSION --></java.version.min>
         <onos.version><!-- ONOS_VERSION --></onos.version>
diff --git a/tools/package/etc/org.apache.karaf.features.cfg b/tools/package/etc/org.apache.karaf.features.cfg
index 863bdc5..beab9a1 100644
--- a/tools/package/etc/org.apache.karaf.features.cfg
+++ b/tools/package/etc/org.apache.karaf.features.cfg
@@ -20,38 +20,38 @@
 #
 # Comma separated list of features repositories to register by default
 #
-featuresRepositories = \    mvn:org.apache.karaf.features/standard/4.2.9/xml/features, \
+featuresRepositories = \    mvn:org.apache.karaf.features/standard/4.2.14/xml/features, \
     mvn:org.onosproject/onos-features/$ONOS_VERSION/xml/features, \
-    mvn:org.apache.karaf.features/enterprise/4.2.9/xml/features, \
-    mvn:org.apache.karaf.features/spring/4.2.9/xml/features, \
-    mvn:org.apache.karaf.features/standard/4.2.9/xml/features, \
-    mvn:org.apache.karaf.features/framework/4.2.9/xml/features
+    mvn:org.apache.karaf.features/enterprise/4.2.14/xml/features, \
+    mvn:org.apache.karaf.features/spring/4.2.14/xml/features, \
+    mvn:org.apache.karaf.features/standard/4.2.14/xml/features, \
+    mvn:org.apache.karaf.features/framework/4.2.14/xml/features
 
 #
 # Comma separated list of features to install at startup
 #
 featuresBoot = \
-    (instance/4.2.9, \
-    package/4.2.9, \
-    log/4.2.9, \
-    ssh/4.2.9, \
-    framework/4.2.9, \
-    system/4.2.9, \
-    eventadmin/4.2.9, \
-    feature/4.2.9, \
-    shell/4.2.9, \
-    management/4.2.9, \
-    service/4.2.9, \
-    jaas/4.2.9, \
-    deployer/4.2.9, \
-    diagnostic/4.2.9, \
-    wrap/2.6.2, \
-    bundle/4.2.9, \
-    config/4.2.9, \
-    kar/4.2.9, \
-    webconsole/4.2.9, \
-    scr/4.2.9, \
-    war/4.2.9), \
+    (instance/4.2.14, \
+    package/4.2.14, \
+    log/4.2.14, \
+    ssh/4.2.14, \
+    framework/4.2.14, \
+    system/4.2.14, \
+    eventadmin/4.2.14, \
+    feature/4.2.14, \
+    shell/4.2.14, \
+    management/4.2.14, \
+    service/4.2.14, \
+    jaas/4.2.14, \
+    deployer/4.2.14, \
+    diagnostic/4.2.14, \
+    wrap/2.6.7, \
+    bundle/4.2.14, \
+    config/4.2.14, \
+    kar/4.2.14, \
+    webconsole/4.2.14, \
+    scr/4.2.14, \
+    war/4.2.14), \
     (onos-thirdparty-base/$ONOS_VERSION), \
     (onos-api/$ONOS_VERSION, \
     onos-core/$ONOS_VERSION, \
diff --git a/tools/package/etc/startup.properties b/tools/package/etc/startup.properties
index 996b47b..ddcfcbf 100644
--- a/tools/package/etc/startup.properties
+++ b/tools/package/etc/startup.properties
@@ -1,21 +1,17 @@
-# Valid for Karaf 4.2.9. If updating Karaf version in ONOS, make sure to
-# copy-paste here the content of apache-karaf-*/etc/startup.properties in, and
-# update the Kafka and log4j2 additions at the end if needed
-
-# Standard startup.properties file
 # Bundles to be started on startup, with startlevel
-mvn\:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.9 = 1
-mvn\:org.ops4j.pax.url/pax-url-aether/2.6.2 = 5
-mvn\:org.apache.karaf.services/org.apache.karaf.services.eventadmin/4.2.9 = 5
-mvn\:org.apache.felix/org.apache.felix.metatype/1.2.2 = 5
-mvn\:org.ops4j.pax.logging/pax-logging-api/1.11.6 = 8
-mvn\:org.ops4j.pax.logging/pax-logging-log4j2/1.11.6 = 8
+mvn\:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.14 = 1
+mvn\:org.apache.karaf.services/org.apache.karaf.services.eventadmin/4.2.14 = 5
+mvn\:org.apache.felix/org.apache.felix.metatype/1.2.4 = 5
+mvn\:org.ops4j.pax.url/pax-url-aether/2.6.7 = 5
+mvn\:org.ops4j.pax.logging/pax-logging-log4j2/1.11.12 = 8
+mvn\:org.ops4j.pax.logging/pax-logging-api/1.11.12 = 8
 mvn\:org.fusesource.jansi/jansi/1.18 = 8
+mvn\:org.osgi/org.osgi.util.promise/1.1.1 = 9
 mvn\:org.apache.felix/org.apache.felix.coordinator/1.0.2 = 9
-mvn\:org.apache.felix/org.apache.felix.configadmin/1.9.16 = 10
-mvn\:org.apache.felix/org.apache.felix.fileinstall/3.6.6 = 11
-mvn\:org.apache.karaf.features/org.apache.karaf.features.core/4.2.9 = 15
-
+mvn\:org.osgi/org.osgi.util.function/1.1.0 = 9
+mvn\:org.apache.felix/org.apache.felix.configadmin/1.9.22 = 10
+mvn\:org.apache.felix/org.apache.felix.fileinstall/3.7.2 = 11
+mvn\:org.apache.karaf.features/org.apache.karaf.features.core/4.2.14 = 15
 
 # Added part to enable Kafka log4j2 appender
 # N.B.: kafka-clients should have startlevel lower than onos-tools-package-log4j2-extra
diff --git a/tools/package/onos-prep-karaf b/tools/package/onos-prep-karaf
index 45029ea..f81634b 100755
--- a/tools/package/onos-prep-karaf
+++ b/tools/package/onos-prep-karaf
@@ -13,7 +13,7 @@
 LOG4J2_EXTRA=$6
 SANDBOX=${7:-.}
 
-KARAF_VERSION="4.2.9"
+KARAF_VERSION="4.2.14"
 ONOS_SECURITY_MODE="false"
 
 PREFIX="onos-$ONOS_VERSION"
@@ -38,10 +38,6 @@
 echo "felix.fileinstall.filter='\\*.jar'" >> \
     $KARAF_DIR/etc/org.apache.felix.fileinstall-deploy.cfg
 
-# Patch log4j to mitigate CVE-2021-44228
-# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
-zip -q -d  $KARAF_DIR/system/org/ops4j/pax/logging/pax-logging-log4j2/1.11.6/pax-logging-log4j2-1.11.6.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
-
 # Patch-in proper Karaf version into the startup script
 perl -pi.bk -e 's/apache-karaf-\$KARAF_VERSION/$ENV{KARAF_DIR}/g' $SANDBOX/bin/onos-service
 
diff --git a/tools/package/onos_stage.py b/tools/package/onos_stage.py
index 9dc1973..7a48650 100755
--- a/tools/package/onos_stage.py
+++ b/tools/package/onos_stage.py
@@ -27,7 +27,7 @@
 
 written_files = set()
 now = time.time()
-karaf_version = "4.2.9"
+karaf_version = "4.2.14"
 karaf_system = "apache-karaf-" + karaf_version + "/system/"
 
 def addFile(tar, dest, file, file_size):