Friday, May 1, 2009

Liferay: Build File part of Sample Struts Portlet Breaks the Service Builder

If you are using SDK environment to build your standalone struts portlet and also building your services in the same environment don’t make the mistake of blindly using the build file provided in the sample liferay strurts portlet (http://svn.liferay.com/repos/public/plugins/trunk/portlets/sample-struts-liferay-portlet). If you use the build file, you will be astonished to see that your service classes are not being picked at the compile time and the build fails. On the other hand if you use the default build file created by the liferay SDK environment the struts classes are not added to the classpath. The result is same - the build fails. So problems never leave you – which ever way you go problem will accompany you. 

If you are using build file from the sample struts portlet make sure you amend the build file to add “docroot/WEB-INF/lib” to the class path. Add following to “plugin-lib.classpath” in the build file: 

If you are using the default build file, modify the “compile” target to add "${app.server.lib.portal.dir}" to the build time class path. This will add the portal-impl.jar to the classpath while compiling. 

                                                              

1 comment:

Cherry said...

hi, i am not sure where to edit it. I had found a file build-common-plugin.xml under my liferay/plugins with the following :-
<path id="plugin-lib.classpath">
<fileset dir="docroot/WEB-INF/lib" includes="*.jar"/>
<pathelement location="docroot/WEB-INF/classes"/>/
</path>

Is it the place to edit? and how to edit as mentioned to your suggestion? Thank you very much