Applications are delivered through Liferay Marketplace as lpkg files. This is a simple compressed file format that contains .jar files for deploying to Liferay DXP. If you want to examine an application from Marketplace, all you have to do is unzip its .lpkg file to reveal its .jar files.
After examining an application, you may want to customize one of its .jars. Make your customization in a copy of the .jar, but don’t deploy it the way you’d normally deploy an application. By overriding the .lpkg file, you can update application modules without modifying the original .lpgk file. Here are the steps:
Shut down Liferay DXP.
Create a folder called
Name your updated .jar the same as the .jar in the original .lpkg, minus the version information. For example, if you’re overriding the
Liferay CE Amazon Rankings.lpkg, you’d name your .jar
Copy this .jar into the
overridefolder you created in step one.
This works for applications from Marketplace, but there’s also the static .lpkg that contains core Liferay technology and third-party utilities (such as the servlet API, Apache utilities, etc.). To customize or patch any of these .jar files, follow this process:
Make your customization and package it in a .jar file.
Name your .jar the same as the original .jar, minus the version information. For example, a customized
Copy the .jar into the
Now start Liferay DXP. Note that any time you add and remove .jars this way, Liferay DXP must be shut down and then restarted for the changes to take effect.
If you must roll back your customizations, delete the overriding .jar files: Liferay DXP uses the original .jar on its next startup.