Based on service.xml
, Liferay's Service Builder generates Java files, directories, other files and database tables. It also extracts interfaces from code written after this generation.
When I rename a method or delete a class, Liferay does not clean up anything, the methods/classes/tables just stay there.
How to clean these old artifacts from a portlet project, with the same effect as if I re-wrote it from scratch again?
Warning: First make backups.
Exit any IDE like Liferay IDE, Liferay Studio, Eclipse.
run ant clean
to clear out generated artifacts so you can ensure the only thing left is your code after following the rest of the steps below.
Temporarily move your implementation files from docroot/WEB-INF/src/yournamespace/service/impl
out of the way, for instance move it to your home folder.
Delete the following folders (and all of their sub-folders) from your portlet project:
docroot/WEB-INF/service
docroot/WEB-INF/sql
docroot/WEB-INF/src/yournamespace
(make sure again that you have moved your implementation files to a safe place)service.xml
<namespace>
tag, for instance MyNamespace
MyNamespace_
.docroot/WEB-INF/src/yournamespace/service/impl
Feel free to add your tips and more things to clean!