4

I work in a team of Java developers. We write the code in Eclipse, and then we use maven to build the war. Afterwards we deploy the war in Tomcat.

Is there a free way to autodeploy files on save ?

Thanks.

user1271955
  • 41
  • 1
  • 2

5 Answers5

10

JRebel gives you exactly that: auto-deploy files on save, using Eclipse AND Tomcat, but you do have to pay for it.

I recommend JRebel, but a quick glance around for free alternatives brings up this SO question, where someone suggested the Dynamic Code Evolution VM as a similar product.

There is a good article on the different ways to hot-deploy Java web apps here, which also details some of the other approaches already mentioned.

Community
  • 1
  • 1
seanhodges
  • 17,426
  • 15
  • 71
  • 93
3

If you want to deploy for testing purpose on your developer machine, you should use the Tomcat Maven Plugin or, better the Maven Jetty Plugin (it's better because it's lighter and faster).

If you want to deploy it on a remote server, say at every commit on your SCM you must use Contiuous Integration tools like, for example, Jenkins or Apache Continuum.

Andrea Colleoni
  • 5,919
  • 3
  • 30
  • 49
0

If you have your class files, you could put them in WEB-INF/classes. Is that what you were looking for?

Chetter Hummin
  • 6,687
  • 8
  • 32
  • 44
0

You can use the maven jetty plugin

bluesman
  • 2,242
  • 2
  • 25
  • 35
0

Don't build with maven, use exploded deployment, so that static UI files and JSPs could be picked up automatically by the container. For reloading changes to classfiles, you can run the application in debug session and use hotswap (which allows you only the changes to method bodies) or overcome your demand for free software and buy yourself a JRebel license, which can be used for free on non-commercial projects (http://social.jrebel.com)

Anton Arhipov
  • 6,479
  • 1
  • 35
  • 43
  • static UI files and JSPs are infact picked up automatically when using Maven ('mvn tomcat:run' or 'mvn jetty:run') – rlovtang Mar 25 '12 at 12:28
  • sure. it just depends on the setup. jetty and tomcat maven plugins read the resources from the original locations but it is not the same with IDE-based environments. Embedded Jetty, either vanilla or as maven plugin is indeed a very good solution for this problem, though not perfect. – Anton Arhipov Mar 25 '12 at 18:16