Reputation: 3085
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
Upvotes: 0
Views: 236
Reputation: 13181
> 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>
Upvotes: 1