5

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?

jirka.pinkas
  • 918
  • 6
  • 21

2 Answers2

1

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.

jirka.pinkas
  • 918
  • 6
  • 21
0

Your application can be packaged in WAR for JRebel to work, no problem there. Did you put rebel.xml configuration file into the WAR?

Anton Arhipov
  • 6,479
  • 1
  • 35
  • 43
  • yes, I have rebel.xml in classpath. I edited the question so anybody would be able to re-create this situation. – jirka.pinkas Nov 21 '12 at 19:44
  • You have rebel.xml in classpath, meaning it is packaged within WEB-INF/classes in the WAR, right? Please enable JRebel logging with -Drebel.log=true VM argument and send the log to JRebel support, we'll figure it out. It is either the agent monitoring some other directory or a version specifig bug. BTW, JRebel usually prints to stdout, which directories it monitors. – Anton Arhipov Nov 21 '12 at 23:14