如何在 /etc/config.properties 文件的 Karaf 中追加 config.properties 中的属性?

How to append to properties in config.properties in Karaf in the /etc/config.properties file?

在 Karaf 中 /etc/config 中有两个文件,它们是 config.propertiescustom.properties。正如我在 config.properties 中读到的那样,我应该覆盖 custom.properties 中的值。我想附加到 org.osgi.framework.system.packages.extra 键。

但是我不明白如何附加到它,我当然可以将它的值完全复制到 custom.properties 并为其添加一个值,但是它在 [=14= 中确实很大].在 custom.properties 中,我想要一些简单的东西:

org.osgi.framework.system.packages.extra = \
    universe.microservice.shared.service

AFAIK,无法附加到键的值。如果有的话,也应该有一种方法来获得 "insert" 和 "remove" 值,这要复杂得多。

只需复制带有默认值的密钥,然后按您希望的方式进行修改。事实上,您将它放在单独的文件 (custom.properties) 中,这是将您的更改放在一边的好方法。您可以随时 diff 这两个文件来检查您更改了什么。当您决定将来升级时,这会非常方便。