简体   繁体   中英

maven mvn eclipse:eclipse does not include webapp dependencies in deployment assembly

I created a webapp java project, with a pom file. then I type "mvn eclipse:eclipse" and import it into eclipse.

(btw, how do you usually directly import a java project into eclipse? I have always found eclipse:eclipse works perfectly, just that I have to do this extra step to type eclipse:eclipse )

then in eclipse, I edit and compile the project, all good. but when I run the project on a tomcat server in eclipse, it fails to find many basic dependency classes such as javax.servlet etc. The reason is that these dependency jars are not included into the deployment assembly into WEB-APP/lib. I have to manually click "properties"-->"assembly"-->add ...

is there a way to tell mvn eclipse:eclipse to do this automatically?

thanks Yang

> how do you usually directly import a java project into eclipse

Installing m2e plugin enables importing Maven projects directly from the Import Project wizard.

> it fails to find many basic dependency classes such as javax.servlet

This should not happen as long as you include those dependencies in your POM:

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>servlet-api</artifactId>
  <version>2.5</version>
  <scope>provided</scope>
</dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM