adobe / adobe/aemanalyser-maven-plugin
RepoInitValidator fails at bundles with Sling-Inital-Content with "cq:Component" nodes
- Dominant language
- Java
- Stars
- 30
- Forks
- 25
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 2
Description
since version 1.6.20, the new repoinit analyser fails with a couple for bundles from wcm.io, using Sling-Initial-Content to deploy the apps content.
example failure:
```
[INFO] Creating node /apps/wcm-io/wcm/commons/components/page/structureElement with primary type cq:Component
[ERROR] Repoinit execution validation failed for feature archetype.it:archetype.it.iotaCloudProject.all:slingosgifeature:aggregated-author:1.0.0-SNAPSHOT
org.apache.sling.jcr.repoinit.impl.RepoInitException: CreatePath execution failed at structureElement(cq:Component): javax.jcr.nodetype.NoSuchNodeTypeException: Node type cq:Component does not exist
at org.apache.sling.jcr.repoinit.impl.DoNothingVisitor.report (DoNothingVisitor.java:71)
at org.apache.sling.jcr.repoinit.impl.NodeVisitor.createNodes (NodeVisitor.java:116)
at org.apache.sling.jcr.repoinit.impl.NodeVisitor.visitCreatePath (NodeVisitor.java:63)
at org.apache.sling.repoinit.parser.operations.CreatePath.accept (CreatePath.java:101)
at java.util.Arrays$ArrayList.forEach (Arrays.java:4305)
at org.apache.sling.jcr.repoinit.impl.JcrRepoInitOpsProcessorImpl.lambda$apply$0 (JcrRepoInitOpsProcessorImpl.java:72)
at java.util.ArrayList.forEach (ArrayList.java:1596)
at org.apache.sling.jcr.repoinit.impl.JcrRepoInitOpsProcessorImpl.lambda$apply$1 (JcrRepoInitOpsProcessorImpl.java:70)
at java.util.Spliterators$ArraySpliterator.forEachRemaining (Spliterators.java:1024)
at java.util.stream.ReferencePipeline$Head.forEach (ReferencePipeline.java:762)
at org.apache.sling.jcr.repoinit.impl.JcrRepoInitOpsProcessorImpl.apply (JcrRepoInitOpsProcessorImpl.java:69)
at com.adobe.aem.analyser.RepoInitValidator.validate (RepoInitValidator.java:116)
at com.adobe.aem.analyser.AemAnalyser.validateRepoinitExecution (AemAnalyser.java:316)
at com.adobe.aem.analyser.AemAnalyser.analyse (AemAnalyser.java:296)
...
```
referencing this node:
https://github.com/wcm-io/io.wcm.wcm.commons/blob/develop/src/main/webapp/app-root/components/page/structureElement.json
this is not part of any repoinit script provided by our bundles. but it seems repoinit analyser is building a repoinit script itself from the Sling-Initial-Content structures, and than fails on this one.
---
i think the detection of CND files is not sufficient. it currently auto-detects and CND files with pattern `SLING-INF/nodetypes/*.cnd` in the JAR files, but this detects only a couple CND files from sling bundles. another plugin that needs the CND files, the [Jackrabbit FileVault Package Maven Plugin](https://jackrabbit.apache.org/filevault-package-maven-plugin) allows to manually configure CND files to register. example: https://github.com/wcm-io/io.wcm.maven.aem-global-parent/blob/71b881ad3c31ab278ca2cf4d20fa03a21d146509/pom.xml#L353-L385
Contributor guide
Assessment
This issue has not been assessed yet.