-1

I've recently started learning about Maven and my question is about standard ways for deploying my web application on a web/app-server.

I am able to create war file for a simple web application that uses spring and mysql. I would like to deploy the same on server and test the application. I could see some documents/articles that mention about Jetty for application deployment. I also saw some documentation that talks about Tomcat for application deployment.

I would like to know, which server normally is used while developing application with Maven?

Vicky
  • 5,380
  • 18
  • 60
  • 83

3 Answers3

2

Both can be used, and there is no "standard" as such, but they have a few key differences:

Jetty has traditionally had better support for embedding within your own code (starting from code, for instance a test), although I hear this has gotten better in Tomcat 7. Jetty is probably the fastest of the two, while Tomcat has much higher standards compliance. If your application is to be run on a different applications server in production, Tomcat is probably the best choice.

krosenvold
  • 75,535
  • 32
  • 152
  • 208
2

Both Tomcat and Jetty have multiple ways allowing developers to deploy applications on them. And although I haven't used this myself, many people have recommended Cargo which, as you can see, supports not only Jetty/Tomcat but many other web containers (and not only via Maven).

Above said, you should probably choose server based on other criteria (features / speed / RAM consumption / community / other things mentioned by krosenvold). People have already discussed that here before:

We use Tomcat mainly because somebody did this decision years ago and there's little point to switch to something else.

Community
  • 1
  • 1
mindas
  • 26,463
  • 15
  • 97
  • 154
1

You can use the Maven Tomcat plugin for deploying to Tomcat.

anon
  • 1,071
  • 2
  • 8
  • 19