Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

\/etc/map with filevault-package-maven-plugin in version 1.1.4

Avatar

Level 3

I try to use the newest Versoin of filevault-package-maven-plugin. 

<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<version>1.1.4</version>

 Everything ist working ok. But I tried to add my sling mappings under /etc/map in the project (as usual). But this is not working.

I found an article, that descriibes where to put the different folders. But they missed the /etc/map Folder for Sling Mappings

https://wcm-io.atlassian.net/wiki/spaces/WCMIO/pages/1353056261/How+to+make+your+content+packages+co...

 

I tried to set the /etc/map folder as "validRoot", but same Error, I even tried to move the etc Folder under /apps/etc, the Problem was still there.

Here is a sample of the error. it doesn't matter if the folder is in /etc oder /apps/etc.

[WARNING] ValidationViolation: "jackrabbit-nodetypes: Invalid primary type sling:Mapping: 'sling: is not a registered namespace prefix.'. Skip validation of nodes with that type/name", filePath=jcr_root\apps\etc\map\local\http\.content.xml, nodePath=/apps/etc/map/local/http, line=4, column=56
[ERROR] ValidationViolation: "jackrabbit-filter: Ancestor node '/apps/etc/map/local/http' is not covered by any of the filter rules. Preferably depend on a package that provides this node or include it in the filter rules!", filePath=jcr_root\apps\etc\map\local\http\.content.xml
[ERROR] ValidationViolation: "jackrabbit-filter: Ancestor node '/apps/etc/map/entw/https' is not covered by any of the filter rules. Preferably depend on a package that provides this node or include it in the filter rules!", filePath=jcr_root\apps\etc\map\entw\https\.content.xml
[ERROR] ValidationViolation: "jackrabbit-filter: Ancestor node '/apps/etc/map/test/https' is not covered by any of the filter rules. Preferably depend on a package that provides this node or include it in the filter rules!", filePath=jcr_root\apps\etc\map\test\https\.content.xml
[ERROR] ValidationViolation: "jackrabbit-filter: Ancestor node '/apps/etc/map/qual/https' is not covered by any of the filter rules. Preferably depend on a package that provides this node or include it in the filter rules!", filePath=jcr_root\apps\etc\map\qual\https\.content.xml
[ERROR] ValidationViolation: "jackrabbit-filter: Ancestor node '/apps/etc/map/prod/https' is not covered by any of the filter rules. Preferably depend on a package that provides this node or include it in the filter rules!", filePath=jcr_root\apps\etc\map\prod\https\.content.xml

 But the errors are different: I know that the Package "Application" just can use "/libs" and "/apps". But where do I have to put "/etc/map"?

[ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain content outside '/libs' and '/apps'!", filePath=jcr_root\etc\map\prod\https

 Does anybody know how to Configure the "etc/map" Folders, that they will be installed with the Project? Or are there new solutions for that? I found no description or tutorials for that problem.

 

For Help I used those links:

https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/developing/repo...

https://jackrabbit.apache.org/filevault/validation.html

https://docs.adobe.com/content/help/de-DE/experience-manager-64/deploying/configuring/resource-mappi...

https://github.com/adobe/aem-guides-wknd

 

1 Accepted Solution

Avatar

Correct answer by
Level 1

Try in ui.content it will work even with /etc no build errors.

 

This is how i did it.

added

/etc/map.dev.publish under ui.content/src/main/content/jcr_root 

/etc/map.prod.publish under ui.content/src/main/content/jcr_root

..

the filter.xml in ui.content looks like

 

<filter root="/etc/map.dev.publish" mode="merge"/>

<filter root="/etc/map.prod.publish" mode="merge"/>

..

 

and that it, Build it and see the magic :).

 

Regards,

Venkatesh Gajavelli.

View solution in original post

6 Replies

Avatar

Community Advisor

The Sling Mapping should be under /etc/map but seems you are trying to enable under /apps/etc/map

Refer https://techforum.medium.com/configure-sling-mapping-for-resource-resolution-in-adobe-experience-man... for more details on enabling Sling Mapping.

Regards

Albin I

www.albinsblog.com

 

 

Avatar

Level 3
no I tried both! It's not accepted under /etc/map with the new filevault version. See the second error

Avatar

Level 4

@Albin_Issac how to commit /etc/map nodes? They are neither accepted in ui.apps, or ui.config.

Avatar

Community Advisor

Try to add the /etc/map configurations under /ui.content project - /ui.content/src/main/content/jcr_root/etc/

Ensure the filter is enabled - /ui.content/src/main/content/META-INF/vault/filter.xml

<filter root="/etc/map.production.publish"/>
<filter root="/etc/map.stage.publish"/>
<filter root="/etc/map.uat.publish"/>
 
Regards
Albin I

Avatar

Level 3

Adobe has not a really good solution for it. I think they have changed a lot, but it's not fully tested yet. They have some gaps in the architecture.

As a workaround we have moved the map folder from /etc/map to /conf/map. In the Project folder the /conf folder is in module ui.content.

That the map will work you have to set the root of map in the JcrResourceResolverFactory to /conf/map/test, /conf/map/prod. So each environment needs its own config.

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
          xmlns:jcr="http://www.jcp.org/jcr/1.0"
          jcr:primaryType="sling:OsgiConfig"
          resource.resolver.map.location="/conf/map/entw"
          resource.resolver.default.vanity.redirect.status="301"
          resource.resolver.vanity.precedence="{Boolean}true"
          resource.resolver.mapping="[/-/]"
/>

the filter.xml in ui.content looks like

 

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
	<filter root="/conf/map/local/http/local.{mydomain}" mode="merge"/>
	<filter root="/conf/map/entw/https/entw.{mydomain}" mode="merge"/>
	<filter root="/conf/map/test/https/test.{mydomain}" mode="merge"/>
	<filter root="/conf/map/prod/https/{mydomain}" mode="merge"/>

And don't use any path with /etc the build is going crazy. There are solutions to use hybrid mode and some weard stuff, but nothing is really working. So better don't use /etc. 

Avatar

Correct answer by
Level 1

Try in ui.content it will work even with /etc no build errors.

 

This is how i did it.

added

/etc/map.dev.publish under ui.content/src/main/content/jcr_root 

/etc/map.prod.publish under ui.content/src/main/content/jcr_root

..

the filter.xml in ui.content looks like

 

<filter root="/etc/map.dev.publish" mode="merge"/>

<filter root="/etc/map.prod.publish" mode="merge"/>

..

 

and that it, Build it and see the magic :).

 

Regards,

Venkatesh Gajavelli.