In Liferay development, it’s very useful to have Source Code available to you for the purpose of troubleshooting and debugging. This is especially useful when you get an error in the log on the server with a stack trace and a line number. With the source code, you can always look at the code and investigate in detail the root cause of the error. You can always download the Source Code of your portal from liferay.com and setup with your IDE(this is useful for local debugging with breakpoints)
However, this becomes challenging when you have Liferay EE subscription and you have applied patches to your portal. It is possible that your source code is out-of-date/out-of-sync with your deployed portal code. Luckily, Liferay patching tool provides you a way to patch your source code.
To begin, go to your patching-tool directory
Create a new profile to be used for patching the source code. To achieve this create patch-source.properties under patching-tool directory
In the above example, we have set a patching mode and location of the source code which has to be patched. For more details refer to the documentation or run ./patching-tool.sh help
Run the patching tool with the custom profile created in above step. Since the name of our file was patch-source.properties our profile name is patch-source
./patching-tool.sh patch-source install