Maven does not create the "/target/m2e-wtp/web-resources" folder

Muhammad Gelbana picture Muhammad Gelbana · Sep 15, 2014 · Viewed 44.4k times · Source

I'm using Eclipse Luna. I'm working on a Maven project. When I try to run my application on a weblogic's application server, and exception is thrown with the message:

weblogic.application.ModuleException: [HTTP:101027][WebAppModule(_auto_generated_ear_:MyAppName)] Document root: "D:\MGelbana\workspace\my-app-name\target\m2e-wtp\web-resources" does not exist.

I looked into the project's deployment assembly configuration and found the following error message: Cannot find entry: "/target/m2e-wtp/web-resources"

enter image description here

So I thought Luna's default Maven installation isn't what I need to I uninstalled it and I installed M2E-WTP from this URL (http://download.eclipse.org/m2e-wtp/releases/luna/) but I believe I ended up with the same version and same options.

I understand that this plugin has the option of generating this folder /target/m2e-wtp/web-resources which helps Eclipse to deploy an application into an application server (Run on server option)

(Which is my end goal but I'm having issues with deploying the application with it's needed dependencies. If I generate the application's WAR file by Installing the maven project and deploying the generated that WAR manually, the application works, but I need to be able to debug\run it on the application server using Eclipse.)

But this folder (i.e. /target/m2e-wtp/web-resources) isn't created !

In Eclipse's Maven > Java EE Integration > WAR project preferences > Maven archiver generated files under the build directory (I checked this option)

In the project-specific options, I only have a Maven menu and a Lifecycle mapping sub-menu and nothing to do with the maven archiver generating files or not !

So how can I direct maven to output the WTP related files ?

enter image description here

Answer

Tharaka picture Tharaka · Dec 27, 2014

I was struggling with the same issue for couple of days. Ultimately following worked for me.

  • Install m2e-wtp from eclipse marketplace (if it's not already installed)
  • Open project preferences -> Project Facets -> Runtimes -> Select the runtime of your choice (Tomcat 7 in my case)