Legacy Knowledge Base
Published Jun. 30, 2025

LAR File Auto Deployment

Written By

Kenny Back

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Is there any way to programmatically load LAR files out of the box?

Environment

  • All Liferay Versions

Resolution

  • At this time there is no out-of-the-box method for auto-deploying LAR files.
  • LAR files cannot be imported via the auto deploy folder either, only through the UI export/import menu.

Additional Information

With that said please see the following potential alternatives firstly noting this liferay developer's blog which covers the important points for consideration when using LAR files.

One option you could try are 'internal APIs' (for example, if you deploy your own module to Liferay and make the appropriate API calls there). You can see a sample of what that code looks like inside of GroupLocalServiceImpl.java#L4028-L4063

A second option you could also try are 'remote APIs'. If you search your bundle for /api/jsonws for a method named import-layouts, you’ll find two methods which theoretically allow the import of a LAR, provided the right objects are passed to allow the import to happen.

Further Considerations (As automating the LAR import process may depend on a variety of factors, including, but not limited to): 

  • Whether it’s a one-time site initialization or continuous updates (CI/CD Pipeline)
  • Whether there is an upgrade plan that accounts for LAR files not being compatible across versions
  • The row-locking and table-locking characteristics of the database in use
  • How long the LAR import takes to complete
Did this article resolve your issue ?

Legacy Knowledge Base