2009年2月8日 星期日

How to redeploy the war without stop the jetty run by mvn

Recently, we start to use Appfuse 2.0 as our primary development platform.
Appfuse 2.0 is whole new framework to us, it's a new journey for us to complete our system.
I encounter a troublesome problem when building our prototype, due to the unfamiliar with the Maven environment. That's redeploy the war file and restart the jetty.
Well, this is a very common usage scenario in development stage. But to start the mvn with jetty:run-war is time consuming. So, I post the question to Appfuse user forum and two nice people response to me (I am very appreciate to Marc and IceMan).

To solve my problem, All I have to do is running the jetty in place with following command (this is also documented in appfuse documentation ).

mvn war:inplace
mvn jetty:run

But, when you execute mvn jetty:run, the system will report you the following message:
unable to load bean:type: class:com.opensymphony.xwork2.ObjectFactory
this is due to the duplicate class library and struts.xml
So, to deal with this problem is going to the src/main/webapp/WEB-INF folder.
Delete the lib folder and remove the struts.xml under the classes folder.
After that, you can modify the jsp file without stop the jetty.

Reference
:

  1. http://www.nabble.com/How-to-redeploy-the-war-without-stop-the-jetty-run-by-mvn-td21843382s2369.html
  2. http://blog.csdn.net/Jiangcx/archive/2008/05/05/2393209.aspx

沒有留言: