@Keerthi0555
If you want to iterate through all the resources then go with iterator.
If you want a specific resource(s) with specific property then search using query builder.
Depends on your use case.
@Keerthi0555
You missed single quote at the end of component path.
String queryString = "SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node," +path+")"+ "AND [sling:resourceType] = 'apps/components/componentName'"
Running command prompt as admin will fix the build issue. If you don't have admin right in your system then set includeDispatcherConfig = n and run the command.
@Venkat_SaiGa
Try as per below link.
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/unable-to-get-current-page-path-in-cloud-publisher-environment/m-p/608891#M152804
Then adapt page resource to Page.class and get title.