Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 922
Muhammad Gelbana Avatar asked Sep 15 '14 08:09

Muhammad Gelbana


People also ask

What is m2e wtp folder?

What is this web resources folder? target/m2e-wtp/web-resources/ is a folder containing automatically generated resources, that need to be deployed on the application server. These generated resources are : pom. properties and MANIFEST.

What is deployed resources in eclipse?

Summary. When developing a web application in eclipse, the default deploy path of java classes is “WEB-INF/classes” and every folder defined under WebContent is automatically deployed under the root path of the application.


1 Answers

I was struggling with the same issue for a couple of days. Ultimately the following steps 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)
like image 140
Tharaka Avatar answered Sep 23 '22 12:09

Tharaka