I have been using maven projects in hudson quite successfully for some time.
However this time I need to build an eclipse dynamic web project that is usually built within eclipse and then the war is exported to production. How can I build this project in hudson.
Thanks in advance!
If you’re familiar with Maven, I suggest you use the
m2e-wtpplugin — that way you can use both Maven and WTP for your web app. It should be somehwhere in the m2e catalogue (Window > Preferences > Maven) now that m2e moved to the Eclipse Foundation, check Maven/Tomcat Projects In Eclipse Indigo/3.7 for more.If you already have a Dynamic Web Project in Eclipse, you’ll probably have to move around a bunch of folders to arrange them in the structure Maven expects:
Set the
<packaging>towarso Maven knows that it should put your dependencies intoWEB-INF/lib/and build a WAR.As for dependenices, you’ll probably need the Servlet API:
Pay attentation to the
providedscope: The Servlet spec prohibits web apps to bring their own Servlet API JAR along inWEB-INF/liband conforming web containers will refuse to load your web app in that case (they will provide the JAR themselves in the version they support).It’s probably best to start by right-clicking on the Dynamic Web Project and go Maven > Convert to Maven project, then move the folders as shown above and then go through all the warnings the m2e and m2e-wtp plugins throw at you (most offer a quickfix).