Over a million developers have joined DZone.

Jumpstart with Eclipse, Maven and Tomcat (web/app server)

· Java Zone

Discover how powerful static code analysis and ergonomic design make development not only productive but also an enjoyable experience, brought to you in partnership with JetBrains

Q:What is the quick way to setup Eclipse war (possibly ear) project built with maven? 

A: In short: Eclipse + wtp + m2e +m2e-wtp

Sometimes from idea to it's realization is not an easy way.

If you're in a need to quickly setup java war project and you like the tools I do: maven, eclipse and tomcat (or any other server of your choice) following might be useful to jumpstart realizing your ideas.

My requirements

I've searched for a solution that would enable me to:
- use eclipse for application development
- manage server lifecycle directly from eclipse and
- use maven as a build tool.

My choice

Following has been found and based on the short project I've tested it with, it worked very well:
- eclipse - no doubts here (it's my favorite IDE for java development)
- wtp - fits me best for the server management directly from eclipse
- m2e - maven eclipse integration (as I'm in love with maven)
- wtp-m2e - wtp m2e integration (this one I've been missing in the puzzle, but only until today)

As  the last one mentioned was new to me the following video convicted me that it's something I need:


(the video is reffered on the official site as well)

After the initial project setup (depicted on the video) right clicking on the project and choosing "Run/Debug As" -> "Run/Debug on Server" does the job of publish and run/debug.

And once you change your project contents automatic republish happens in the background as well.

Sounds like the initial infrastructure setup time for my next project can be the question of seconds rather that hours.

Learn more about Kotlin, a new programming language designed to solve problems that software developers face every day brought to you in partnership with JetBrains.


Published at DZone with permission of Peter Butkovic, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}