0

I know that maven-build-plugin internally uses curl and hit a POST request to service.jsp page, like this call

curl -u <uid>:<pwd> -X POST
http://localhost:7402/crx/packmgr/service/.json/etc/packages/mycontent.zip?cmd=create 
-d packageName=<name> -d groupName=<name>  

to upload and install package in cq. I'm not able to find any way to install my package on Sling this way.
is there any way so i don't have to manually install package in Sling ?

Shashi
  • 746
  • 10
  • 39

1 Answers1

0
$CURL -X POST -s $HOST/etc/packages/mypackages/$FILENAME?cmd=install

Check out this post on the subject too: https://cqdump.wordpress.com/2014/03/10/using-curl-to-install-cq-packages-and-why-it-isnt-a-good-idea/

It has some useful points to consider on how this could lead to some issues.

Shawn
  • 8,374
  • 5
  • 37
  • 60
  • Thanks @Shawn. Learned something new. but my original question still remains. The other day i was doing Sling Dynamic Include and i had to build and deploy the bundle manually. is there any way i could automate this step with Sling(as i do with CQ via autoInstallPackage profile)? – Shashi Feb 18 '16 at 07:02
  • I understood your original question to be something like "Can curl be used to install a package I have uploaded?" So I thought this answered that. You can install by using a curl POST to the package, with the cmd=install querystring. – Shawn Feb 19 '16 at 19:12
  • Because AEM/CQ is built on REST principles, you can monitor your browser network traffic to discover this and many other tricks that can be replicated in curl (or other HttpClients) – IT Gumby Feb 25 '16 at 03:20