On Friday, March 11, 2011 9:15:42 AM UTC, Thomas Broyer wrote:
>
>
>
> On Friday, March 11, 2011 12:09:08 AM UTC+1, Filipe Sousa wrote:
>>
>> I would like to share some thoughts on the quickest way to develop web 
>> projects in eclipse without wasting time with the redeploy.
>>
>> One thing that annoys me is to make a change in code and having to wait 
>> several minutes while a redeploy is made. I tried several solutions, 
>> including JRebel, but I found that rolling my own embedded server is the 
>> best option. For that I am using the jetty 7. So, I created in my GWT 
>> project (Dynamic Web Project in eclipse), a class called JettyDevServer that 
>> starts the server. This class listens to changes in the contexts/context.xml 
>> file to reload the changes
>>
>
> I use a similar setup, but do not use Jetty as an embedded server, I just 
> launch it using its start.jar.
> In other words, I have the same Jetty setup as we would have in production, 
> the only difference being a context xml file pointing to 
>

We are not using jetty for production but glassfish and tomcat server.
 

> my Eclipse workspace (baseResource as a ResourceCollection pointing to my 
> src/main/webapp (we're using Maven) and target/mywebapp-0.0.1-SNAPSHOT 
> (where a mvn package would have put all the dependencies, in WEB-INF/lib), 
> and extraClasspath pointing to the target/classes of various projects).
> And I start GWT's DevMode with -war target/mywebapp-0.0.1-SNAPSHOT; the 
> net benefit being that nothing is ever generated within my source tree 
> (src/main/webapp).
>
> Is your JettyDevServer a way of somehow "inheriting" the project's 
> classpath in your webapp?
>
>
Yes, I'm using the classpath. Easier to debug
 

> - this has been tested in the Linux
>>
>
> The overall approach works on Windows too (I'm on XP Pro SP3)
>  
>
>> - in the "External Tools Configurations" I use the command /bin/touch. I 
>> don't know what is the equivalent in Windows
>>
>
> That would be "copy /b context.xml+,," (see 
> http://technet.microsoft.com/en-us/library/bb490886.aspx )
>  
>
>> I tested in a project with hundreds of jars and the deploy never exceeded 
>> one second. For that, I do not put the jars inside the 
>> WebContent/WEB-INF/lib since they are never modified (you can use the "Web 
>> Deployment Assembly" later when generating the WAR).
>>
>
> In my setup, I run a "mvn package" or "mvn war:exploded" once, so that all 
> dependencies are copied to target/mywebapp-0.0.1-SNAPSHOT/WEB-INF/lib and 
> then run Jetty. It works very well, given that my dependencies do not change 
> that much. In the event that they change, I could in theory (untested) just 
> run "mvn war:exploded" (or copy the JARs manually) without restarting Jetty, 
> redeploying the webapp would be enough (as I understand it, you would have 
> to restart your JettyDevServer).
>
>
I'm not restarting JettyDevServer. My workflow is: change code on the server 
side, press F1 key (/bin/touch context.xml) to hot deploy in less than a 
second, and finally, refresh the browser. I don't create any WAR, except 
when I want to use on a production server.
 

> It works much better than Jetty WTP / Maven WTP Integration, with which we 
> had numerous issues (sometimes removing classes or JARs, or failing to copy 
> new or updated ones)
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to