A quick update about the Scala support in Liferay SDK
General Blogs December 16, 2013 By Miguel Ángel Pastor Olivar
A few months ago I pushed into the Liferay 's plugins repository the ability to write Scala code in the Liferay portlets but, to be honest, the support was quite poor since the Scala code was only allowed in portlets and you needed to create a new kind of portlet through the create.sh script located in the portlets folder.
A couple of weeks ago I got a chance to resume the work on the Scala support and I have added the ability to write Scala code in any kind of plugin in the plugins SDK. What does it mean? You will be able to write Scala code into your existing plugins (hooks, portlets, new OSGi plugins, ...) with no extra effort at all. Just add your new code into you existing plugin (or create a new application completely written in Scala) and everything will be compiled.
A couple of important tips to be considered:
- Fast scala compiler (fsc) is the selected option for the default compilation process. There is a couple of task to clear the compiler's caches or shutdown the daemon
- You cannot use Scala code in JSP. I know this is obvious but I wanted to highlight it :)
The source code is not still available in the main plugins repo but I will try to merge it in as soon as possible. Meanwhile, you can take a look into my Github repo
I will try to write a new blog post with a practical example about how you can use these new abilities