简体   繁体   中英

Dependant jar doesn't deploy to tomcat where project with this jar is open in workspace

Strange problem, I've got two projects in workspace:

ProjectA

ProjectB

in pom.xml in projectA i've added:

<dependency> <groupId>groupid</groupId> <artifactId>projectB</artifactId> <version>version</version> </dependency>

And when I build application and deploy to tomcat, there is in logs : " NoClassDefFoundError" I've noticed, if I close projectB then immediately app in tomcat works properly. If I open project then app is crushing.

When ProjectB is open, eclipse uses your workspace project to resolve ProjectB dependency. If it is closed, the dependency is taken from your maven repository. This is why the behavior is different.

Have you checked that the missing class is indeed in ProjectB ? If it is, have you checked that the class compiles correctly ? Also, it could be that the class looks ok but is not compiled because ProjectB has build path errors.

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