March 18, 2020
Estimated Post Reading Time ~

Install packages/ bundles automatically on AEM Server on startup

Consider a case where
· You want to install a CRX package/bundle automatically in CRX on server startup.
· You want to install multiple CRX packages/bundles in CRX at a time, without uploading one by one in the CRX package manager.
· You want to install package/bundles that have many dependencies on other packages/bundles and you want to install them in a specific order to resolve dependencies.

For all the above purposes, CQ/AEM is provided with a feature of the “install” folder which must be added manually inside the quickstart folder [i.e. crx-quickstart].
· For CQ 5.4 nad below, folder to be added is /crx-quickstart/repository/install
· For CQ 5.5 and above, folder to be added is /crx-quickstart/install
While starting up, CQ/AEM looks for packages or bundles in the install folder and installs the in alphabetical order.
1. Installing the CRX package/bundle automatically on server startup.

Add the install folder manually in a quickstart folder depending on the CQ version you are using as mentioned above and then copy the CRX package/bundle in the install folder.


When you start CQ/AEM the package/bundle will install automatically.

2. To install multiple CRX packages/bundles in CRX at a time, without uploading one by one in the CRX package manager.

Similar to point 1, add multiple packages/bundles to the install folder.


When you start CQ/AEM the package/bundle will install automatically.


Note: As you can see the packages got installed in alphabetical order. Installation in alphabetical order gives the user an opportunity to resolve dependencies while installing bundles.
3. You want to install package/bundles that have many dependencies on other packages/bundles and you want to install them in a specific order to resolve dependencies.

As in case 2, we can install multiple packages at a time in alphabetical order. So, if a package has dependencies on other packages/bundles, we can install the other packages/bundles first by naming them in alphabetical sequence.
For example, there are 2 packages where the first package has some dependencies on the second package. Then, name the second package as “a” and the first package as “b”, so that second package installs before the first package.

Note: Once the package gets installed, CQ creates a properties file [One properties file for one package], Properties file indicates the installer not to install the same package again on CQ restart.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.