/etc/map with filevault-package-maven-plugin in version 1.1.4 | Community
Skip to main content
fabianh12876403
Level 2
November 2, 2020
Solved

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

  • November 2, 2020
  • 1 reply
  • 4966 views

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+comply+with+Jackrabbit+FileVault+Validation

 

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/repository-structure-package.html

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

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

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

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Venkatesh_Gajavelli

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. 


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.

1 reply

Community Advisor
November 3, 2020

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-manager-deep-dive-b06280a2bf8e?source=your_stories_page------------------------------------- for more details on enabling Sling Mapping.

Regards

Albin I

www.albinsblog.com

 

 

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