How to create an AEM filtered package with CURL

The AEM native CURL API does not allow to create a filtered package, but you can use the following workaround to do it 🙂

The scheme package

What is it ? The scheme package will be a filtered package without content.

First of all you need to create the filtered package on your local environment and download it. Unzip the previous package on your computer. It should contain two folders (jcr_root and META-INF). You need to remove the content of the jcr_root folder. The previous operation allow us to remove the content of the package. Endly you need to zip jcr_root and META-INF folders to create our empty package which will be uploaded via a curl command.

Curl process

The following command allow you to upload the scheme package on the aem environment :

After few seconds, your package will be uploaded on AEM and you will be able to build it :

And download it :

 

3 Comments

  1. You can also just post the resources for the filter. This approach does not require anything but cURL and lets you automatte the whole process.

Leave a Reply