Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to program portlets efficiently using Liferay and Maven?

I can easily create a Maven project for programming portlets (for example using archetype). But in order to deploy this project to Liferay, I have to run:

mvn package liferay:deploy

Even if I change just a simple JSP file, I have to redeploy the whole portlet application. Is there a way to speed up this development process?

I don't want to use Ant, because then I would have to deal with dependencies and other stuff. I would really like to use Maven to develop Liferay portlet applications.

I tried JRebel, but because of the packaging to WAR file it's magic doesn't work :(

To re-create this situation:

  1. Create project from maven archetype with artifactId: liferay-portlet-archetype
  2. Add properties to pom.xml: liferay.version, liferay.auto.deploy.dir
  3. Start Liferay
  4. mvn package liferay:deploy -> this will create a WAR file and deploy it to liferay auto deploy directory.
  5. Each time you want to change something, you must do mvn package liferay:deploy

This is time consuming on something bigger than just hello world.

As far as I know this is supposed to be the best practice. But Liferay documentation is sparse on this subject. Is there another way?

like image 914
jirka.pinkas Avatar asked Nov 12 '22 17:11

jirka.pinkas


1 Answers

Problem solved using combination of STS (SpringSource Tool Suite) and Liferay IDE. With this combination it's not necessary to use Liferay Maven plugin at all. Just simply add Liferay server, deploy Maven app on this server and it all works.

Using this combination with JRebel is IMHO the most effective solution.

like image 116
jirka.pinkas Avatar answered Nov 15 '22 07:11

jirka.pinkas