jackrabbit-filter: Filter root’s ancestor ‘/etc/mobile/groups’

A mobile emulator is a tool used to test how a website or application will appear and function on a mobile device. It allows developers to preview and test their mobile websites or applications without the need for an actual mobile device.

There are several mobile emulators available for AEM, such as the iOS Simulator and Android Emulator. These emulators simulate the functionality and appearance of mobile devices, allowing developers to test their websites or applications as if they were running on an actual device.

In AEM, the “/etc/mobile/groups” is a location where mobile groups are created and managed. Mobile groups are used to segment content for different mobile devices, such as smartphones and tablets. They allow you to configure and tailor your website or application for specific devices, optimizing the user experience for each device type.

Using the /etc/mobile/groups feature, you can create and manage different groups of mobile devices, set up rules for device detection, and define content for each group. This allows you to provide a tailored experience for users based on the device they are using.

When I tried to introduce a new mobile emulator under the path of ui.content/../etc/mobile/groups/sourcedcode, I was getting a big error:


[ERROR] ValidationViolation: “jackrabbit-filter: Filter root’s ancestor ‘/etc/mobile/groups’ is not covered by any of the specified dependencies nor a valid root.”, filePath=META-INF/vault/filter.xml
[INFO] ValidationViolation: “jackrabbit-filter: Found orphaned filter entries: entry with root ‘/etc/mobile/groups/sourcedcode'”


Solution

Under the ui.content/pom.xml it looks like we can add configuration to allow validRoots as a part of the maven build. You can simply add this configuration as a part of the <plugin>, and it should be working as expected.

Keep an eye on the code below, line:16-22.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!-- ====================================================================== -->
<!-- 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>
    <version>1.1.6</version>
    <configuration>
        <properties>
            <cloudManagerTarget>none</cloudManagerTarget>
        </properties>
        <group>com.sourcedcode</group>
        <name>sourcedcode.ui.content</name>
        <packageType>content</packageType>
        <accessControlHandling>merge</accessControlHandling>
        <validatorsSettings>
            <jackrabbit-filter>
                <options>
                    <validRoots>/conf,/content,/content/experience-fragments,/content/dam,/etc/mobile/groups</validRoots>
                </options>
            </jackrabbit-filter>
        </validatorsSettings>
        <dependencies>
            <dependency>
                <groupId>com.sourcedcode</groupId>
                <artifactId>sourcedcode.ui.apps</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </configuration>
</plugin>

Hello, I am an enthusiastic Adobe Community Advisor and a seasoned Lead AEM Developer. I am currently serving as an AEM Technical Lead at MNPDigital.ca, bringing over a decade of extensive web engineering experience and more than eight years of practical AEM experience to the table. My goal is to give back to the AEM Full Stack Development community by sharing my wealth of knowledge with others. You can connect with me on LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back To Top