I added a custom node type to the nodetypes.cnd file. That file is in the META-INF/vault folder. When the package is built, I cannot find this file in the package. Is that a problem? If so, where should this file be copied to? To test if this may be the issue, I manually added the nodetypes.cnd file to the META-IN/vault folder of the package, but this did not solve the problem either. I had successfully use a nodetype.cnd file a few months ago with AEM 6.0 to add a new namespace. I am having an issue doing this now. This time I an using AEM 6.1.
Contents of the nodetypes.cnd file:
Did you also installed this file using package manager. If you just created this file manually then it won't work. To test your use case, I created a package with this file in AEM 6.1 and installed this package. Package installation logs below shows that it is installing new new node types-
Installing node types... - sling -> http://sling.apache.org/jcr/sling/1.0 - nt -> http://www.jcp.org/jcr/nt/1.0 A testXmpExt -> testXmpExt - rep -> internal - sling:Folder - rep:RepoAccessControllable Installing privileges...
Also, after this step I checked the node type administration page and I could see the new namespace registered. - http://localhost:4502/crx/explorer/ui/namespace_editor.jsp?Path=&Callback=reload
The package you provided installed fine. I tweaked mine and it now seems to work. The nodetypes.cnd file in the META-INF/vault folder has the following contents. At first I added another cnd file under apps/shared/nodetypes, but I didn't end up needing it. Thanks for the help.
[sling:Folder] > nt:folder
- * (undefined) multiple
- * (undefined)
+ * (nt:base) = sling:Folder version
+ rep:repoPolicy (rep:Policy) protected ignore
I tested the attached package. Change the extension to ".zip" after download.
I installed the package using package manager. Can you attach the package that you created so I can compare it to mine?
I tried both of the following and neither worked.
I tried adding this file under /apps/testproject/nodetype and it still didn't work.
I think the META-INF/vault location works when you include the cnd file as part of the OSGI bundle and configure the maven-bundle plugin for the same. But to install it using the package manager you can just include this file as normal content in any folder. For example, you can define filters in your package to deploy this file to /apps/<project>/nodetypes/nodetypes.cnd
Yes. I have this.
Did you include the meta-inf folder in your resource element to be included in your bundle?