【问题标题】:AEM - vault -package filter.xml queryAEM - 保险库 -package filter.xml 查询
【发布时间】:2020-07-28 17:00:12
【问题描述】:

在我的应用程序包 filter.xml 中,我给出如下:

<filter root="/apps/site">
    <include pattern="/apps/site/components"/>
    <include pattern="/apps/site/config"/>
    <include pattern="/apps/site/config(.*)?"/>
    <include pattern="/apps/site/install"/>
    <include pattern="/apps/site/pages"/>
    <include pattern="/apps/site/templates"/>    
</filter>

使用上面的代码,当我部署我的包时, 创建的任何新文件夹/文件都会在 crxde 中更新 任何现有的 html 文件更改都会在 crxde 中更新 但是对组件 dialog.xml 的更改没有在 crxde 中更新(解释一下,我直接在 crxde 中的一个组件对话框中进行更改,然后部署我的包。我所做的更改没有从我的代码库中更新是问题)

然后我将以下模式也添加到 filter.xml 中,它就可以工作了。

<include pattern="/apps/site/components(/.*)"/>

如果我们需要在过滤器中包含以下两种模式(如果这需要工作)或者我们是否有替代方法,有人可以帮助我吗?

<include pattern="/apps/site/components"/>
<include pattern="/apps/site/components(/.*)"/>

【问题讨论】:

    标签: maven filter build package aem


    【解决方案1】:

    您观察到的行为是由于向后兼容性。当还没有合并模式时,行为是这样的: 使用替换模式安装匹配过滤器的节点,其他一切使用合并模式(仅添加新内容)。

    所以对于这样的过滤器:

    <filter root="/apps/site">
         <include pattern="/apps/site/components"/>
    </filter>
    

    /apps/site/components 下面的包中的所有内容都是使用合并模式安装的,因为末尾没有通配符。

    如果您将过滤器更改为:

    <filter root="/apps/site">
          <include pattern="/apps/site/components"/>
          <include pattern="/apps/site/components(/.*)"/>
    </filter>
    

    然后它也匹配下面的节点,所以包安装程序使用替换模式。

    【讨论】:

      【解决方案2】:

      为简单起见,您可以使用componentsinstallconfig 等作为过滤器根,即

      <filter root="/apps/site/components">
      <filter root="/apps/site/config">
      <filter root="/apps/site/install">
      

      等等。

      这样,每次安装包时都会替换以/apps/site/components 开头的树,并且不需要include 语句。

      更新: includeexclude 模式是一个很好的做法,当您的包将在树的某些部分安装不完全拥有的东西时;在您的情况下,如果有另一个软件包也可以在 /apps/site 中安装东西。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-03-20
        • 2023-03-02
        • 2020-12-15
        • 2017-01-23
        • 1970-01-01
        相关资源
        最近更新 更多