10

What Java web development environment is the best for absolutely minimizing the build-deploy-test cycle time?

Web development environment: JBOSS, Tomcat, Jetty? Deploy WAR exploded? Copy WAR or use symbolic links? There are factors here I don't know about.

Build-deploy-test cycle? The amount of time it takes to test a change in the browser after making a change to the source code or other resources (including Java source, HTML, JSP, JS, images, etc.).

I am looking to speed up my development by reducing the amount of time I spend watching Ant builds and J2EE containers start. I want the Ruby on Rails experience --- or as close as I can get.

I'd prefer a solution that is web framework agnostic, however if a particular framework is particularly advantageous, then I'd like to hear about it.

Assume all the standard tools are in use: Hibernate, Spring, JMS, etc. If stubbing/mocking support infrastructure is required to make this work, I'm OK with that. In fact, I'm OK with having a development environment that is very different from our production environment if it saves me enough time.

Landon Kuhn
  • 76,451
  • 45
  • 104
  • 130

12 Answers12

7

You should probably take a look at Javarebel:

http://www.zeroturnaround.com/javarebel/

and this thread here:

How to improve productivity when developing Java EE based web applications

Community
  • 1
  • 1
Jonathan Holloway
  • 62,090
  • 32
  • 125
  • 150
6

JBOSS uses Tomcat for its servlet/JSP engine, so that's a wash.

Tomcat does support hot deploy.

Jetty's pretty small and starts quickly, but it doesn't support hot deploy.

Eclipse is merely an IDE. It needs a servlet/JSP engine of some kind. If it's like IntelliJ, you can use any Java EE app server or servlet/JSP engine you'd like.

IntelliJ is pretty darned fast, and you don't have to stop and start the server every time you rebuild. It works off the exploded WAR, so things happen fast.

duffymo
  • 305,152
  • 44
  • 369
  • 561
  • 3
    An easy way to get redeploys on Jetty is to use contexts. You then touch the context xml file, and the web app is reloaded. – Thorbjørn Ravn Andersen Jul 10 '09 at 00:43
  • 1
    "The ContextDeployer may be used to (hot)deploy an arbitrary Context or Web Application with Jetty specific configuration. To statically deploy only standard web applications at startup, use the WebAppDeployer." http://docs.codehaus.org/display/JETTY/ContextDeployer – Thorbjørn Ravn Andersen Jul 10 '09 at 09:20
5

Building (used to be compiling) is a a sign of our times. We need quick validation of our thoughts and our actions. Whenever I find myself building to many times it is usually a sign that I'm not focused. That I don't have a plan. For me this is the time to stop and think. Do a list of things that need to be done (this is web framework agnostic) do them all and test them all after one build.

Ricardo Marimon
  • 10,339
  • 9
  • 52
  • 59
  • 4
    I can't quite get why people up-voted this. This applies for you and your workflow and it doesn't actually answer the question. – vladv Oct 12 '12 at 16:26
3

Jboss Seam together with the Jboss Developer Studio is good for hot deploying everything aside from EJBs (SLSB, SFSB and Entities need redeploy).

Damo
  • 11,410
  • 5
  • 57
  • 74
2

Have you considered Grails?

yawmark
  • 1,934
  • 14
  • 16
2

Deployment is as fast as it can get with Google App-Engine + GWT (optional) + Eclipse Plugin.

Never seen anything faster.

JohnIdol
  • 48,899
  • 61
  • 158
  • 242
  • Don't you have to restart the built-in server every time you change a class? I've had a look at GAE and found that I had to do this. Be nice to know as I could well be wrong. – Damo Jul 10 '09 at 08:42
  • 1
    In my answer I am taking only abuot deployment - anyway, you have to do that (restart the development server) only if you change your server side code - in GAE + GWT most of the logic is client-side so it's not too big a deal. – JohnIdol Jul 10 '09 at 14:00
2

Maven 2 and eclipse. mvn eclipse:eclipse <- pure awesomeness. Also, WTP within eclipse works great (and maven generates working WTP projects).

Brian Dilley
  • 3,888
  • 2
  • 24
  • 24
2
  • Small web containers will load faster than overloaded webcontainers with the kitchen sink built in (.. cough .. jboss ).
  • Some design decisions slow build times (e.g. aspect-weaving based toolkits add an aspect-weaving phase to compile times).
  • Avoid building components that can only be tested after long elaborate load cycles. Caches are a prime culprit here. If your system has deep dependencies on a global cache scattered everywhere you'll need to load the cache every time you need to test something.
  • Unit-testable components, so you can run pieces instead of the whole thing.

I find that projects built reasonably compile, deploy, and startup in a few to 10 seconds, which is usually fine.

Steve B.
  • 55,454
  • 12
  • 93
  • 132
2

Have you tried using Eclipse Java EE and then tell it to deploy to a server managed by Eclipse? Tomcat and JBOss works pretty well in this way. Also allow you to change code in a method, use Ctrl-S and have the class updated inside the server.

MyEclipse also works pretty well like this.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
2

GWT in eclipse is probably the fastest I can think of. Using the hosted mode browser for your tests you can debug and change your code without restarting anything. Just need to click the refresh button in the browser and the changes are there (java, css, etc). One other thing is that GWT is adding this same support to normal browsers (Firefox, IE, Safari) so you can debug from within them the same way. These changes are coming in 2.0. See http://code.google.com/events/io/sessions/GwtPreviewGoogleWebToolkit2.html

Carnell
  • 749
  • 6
  • 10
1

JRuby on Rails. Develop on whatever platform you want, deploy to standard Java servers.

Ben Hughes
  • 14,075
  • 1
  • 41
  • 34
1

I think the best way to avoid the long build deploy tests cycles is writing unit tests for your code. This way you can find bugs without waiting for the build/deploy phases.

For JSP you can edit the JSP files directly in the JBOSS work folder:

> cd $JBOSS_HOME/server/default/tmp
> find -name myJspFile.jsp
./tmp/vfs/automountd798af2a1b44fc64/Jee6Demo.war-bafecc49fc594b00/myJspFile.jsp

If you edit the file in the tmp folder you can test your changes just hitting the browser refresh button.

Wilson Freitas
  • 583
  • 4
  • 13