eclipsemaventomcatm2e-wtp

Maven Eclipse Integration


I have recently started out on Maven. I am trying to integrate Maven+eclipse(Juno)+tomcat7.

I have downloaded m2e-wtp plugin for eclipse and created a Maven project whose structure follows a standard Maven project structure. It is also configured a dynamic web project. It is a multi module project with two modules of flex(f1 AND f2) and one module of webapp(w).I have configured all the plugins correctly and there is no problem with configuration of POMs.

What I want to achieve is :

  1. When I clean and Build project in Eclipse using Project-->Clean,Eclipse does not build the war in target folder of my web application project (w). I also does not copy any of the flex resources to target folder. However,
  2. When I run the project as maven build by right-clicking the web application project and running it as a "maven install" it creates everything as expected.

    My question is that if it is possible to achieve what I mentioned in point (1)? Or the only correct way to do this is the way mentioned in point (2).

  3. I am also not able to deploy the generted files in step 2 automatically in tomcat. Do I need to use another maven plugin for this?

Please note that this i my first experience with Maven + eclispe. I have followed certain tutorials. So, Please be lenient while voting negatively.


Solution

  • From what I know it is not possible to force Eclipse to use Maven directly (I would gladly be proven wrong).

    Eclipse does not use Maven to build (1). Using the m2e plugin, it is possible to run maven to perform the build as you discovered (2).

    If you are looking for that kind of tight integration you can look at NetBeans or IntelliJ who are using Maven natively.

    EDIT:

    About (3) there is a Tomcat-Maven-Plugin that can deploy the WAR file created on a running tomcat instance. Check the Usage page for more details.