On Tue, Aug 4, 2009 at 9:27 AM, massive.boisson<massive.bois...@gmail.com> wrote: > > Hi, I have a maven project (that is web project by its nature) and I want to > run it in eclipse as WTP project. > > I found command (on > http://maven.apache.org/plugins/maven-eclipse-plugin/wtp.html): > mvn -Dwtpversion=R7 eclipse:eclipse > Where wtpversion can be R7, 1.0, 1.5, 2.0 or none (default). > > > As current wtp version is 3.1, can I use > mvn -Dwtpversion=3.1 eclipse:eclipse > > > Or is there a new or prefered way to do this? > >
When you specify the WTP version, you are telling the plugin which type of configuration to generate. Eclipse has the ability to "import" from older versions, so even though WTP version 2.0 is from '08, it shouldn't hurt to use 2.0, then let eclipse import it. At the same time, when using the eclipse plugin, you should ask yourself which you want to depend on more, eclipse or maven? Eclipse and maven both handle many similar tasks, but if you use the eclipse functionality, you are locked into eclipse... There are many eclipse tools that are helpful, but for building and testing, I prefer to leave it to maven. That being the case, what does WTP give you that is most important? IMO, it's the ability to run your web-app right from the IDE... You can install a tomcat runtime right in WTP and tell eclipse to run your web-app in it. If this is the feature you are looking for, then I would say that you could do one better and use the maven-tomcat-plugin to get the same functionality. Instead of using the maven-eclipse-plugin to generate eclipse configuration files, try using the m2eclipse eclipse plugin to have eclipse become more "maven-aware". Then, you can create an eclipse run configuration that launches 'mvn tomcat:run'. You will have the ability to debug your web-app using the eclipse debugger. In addition, you will also have the nifty pom editory that comes with m2eclipse. This will leave you with a project that is more portable across IDEs, in case someone on your team later decides to use something other than eclipse. In addition, your build/test process can be run in a CI environment like hudson. -Wes -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org