Applications are delivered through Liferay Marketplace as lpkg files. This is a simple compressed file format that contains .jar files to be deployed to Liferay DXP. If you want to examine an application from Marketplace, all you have to do is unzip it to reveal the .jar files it contains.
After examining them, you may want to customize one of these applications. Make your customization, but don’t deploy it the way you’d normally deploy an application. Instead, Liferay DXP provides a way to update application modules without modifying the original .lpkg file they’re packaged in, by overriding the .lpkg file. This only takes a few steps:
Shut down Liferay DXP.
Create a folder called
overridein the Liferay DXP instance’s
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.). If you find you need to customize or patch any of these .jar files, deploying these customizations is a similar process:
Make your customization and package your .jar file.
Name your updated .jar the same as the original .jar, minus the version information. For example, a customized
Place this .jar in the
Now start @product. Note that any time you add and remove .jars this way, Liferay DXP must be shut down and then restarted to make the changes take effect.
If you must roll back your customizations, delete the overriding .jar files: Liferay DXP uses the original .jar on its next startup.