排除过滤器不适用于 filevault-package-maven-plugin

Dhi*_*wal 4 adobe aem

我有一个内容包,其中包含在 AEM 6.5 上安装该包时我想要排除的节点。排除配置在filter.xml (META-INF/vault/filter.xml) 中定义。

下面是我的 filter.xml 的表示

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/apps/amzn-biz">
        <exclude pattern="/apps/amzn-biz/i18n(.*)"/>
    </filter>
    <filter root="/apps/sling"/>
</workspaceFilter>
Run Code Online (Sandbox Code Playgroud)

我的 pom.xml 有以下配置

<!-- ====================================================================== -->
            <!-- V A U L T   P A C K A G E   P L U G I N S                              -->
            <!-- ====================================================================== -->
            <plugin>
                <groupId>org.apache.jackrabbit</groupId>
                <artifactId>filevault-package-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <group>amzn-biz</group>
                    <acHandling>merge_preserve</acHandling>
                    <packageType>content</packageType>
                    <embeddeds>
                        <embedded>
                            <groupId>com.amazon.business</groupId>
                            <artifactId>amzn-biz-foundation.core</artifactId>
                            <target>/apps/amzn-biz/install</target>
                        </embedded>
                    </embeddeds>
                    <subPackages>
                        <subPackage>
                            <groupId>com.adobe.cq</groupId>
                            <artifactId>core.wcm.components.all</artifactId>
                            <filter>true</filter>
                        </subPackage>
                        <subPackage>
                            <groupId>com.adobe.cq</groupId>
                            <artifactId>core.wcm.components.examples</artifactId>
                            <filter>true</filter>
                        </subPackage>
                    </subPackages>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.day.jcr.vault</groupId>
                <artifactId>content-package-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <verbose>true</verbose>
                    <failOnError>true</failOnError>
                </configuration>
            </plugin>

Run Code Online (Sandbox Code Playgroud)

我通过将排除模式更改为 尝试了多种方法。/i18n。但这对我没有用。

我还尝试将 filterSource 添加到 filevault-package-maven-plugin 配置中,但随后出现错误 Project contains filter.xml in META-INF/vault but also指定了一个过滤器源。

Ale*_*ndt 5

您必须从内容包中删除节点。您的内容包中不应包含过滤规则未明确涵盖的任何内容。

你的问题是奇怪的向后兼容性。至少在 CQ5 中还没有过滤模式 ( mode="replace|merge|update")。当时的规则是,过滤规则涵盖的所有内容都会被替换。所有其他内容均已合并。当过滤器模式被引入时,它们变得不直观但向后兼容。在您的情况下,i18n 文件夹已合并。

经验法则:再次导入和导出的内容包应该是相同的。(这对你来说不会是这种情况)

有关更多详细信息,请参阅https://jackrabbit.apache.org/filevault/filter.html#Usage_for_Import.2FInstallation中的表格。对于你的 i18n 文件夹,它说:

作为覆盖规则祖先的节点:从内容包反序列化(出于向后兼容性原因),不是覆盖规则祖先的节点:未触及。人们不应该依赖这种行为,即内容包中的所有项目应该始终被某种过滤规则覆盖以使行为更加明确。