1. Run the below from the root liferay source folder directory
ant clean start build-ext
2. After you do that you can build individual jars. In my case portal-impl.jar contains a buggy class in version 5.2.3. After I fixed the problem I just run the below from the portal-impl folder:
3. Stop the application server.
4. Copy the jar to liferay application WEB-INF/lib replacing that way the original file in there, for example:
cp portal-impl.jar ~/glassfishv3/glassfish/domains/liferay-domain/applications/liferay-portal-5.2.3/WEB-INF/lib/
5. Start the application Server.