eclipse-maven 项目 - 从 eclipse 运行 NoClassDefFoundError 但从命令行运行良好
我在运行时解析 jar 文件时遇到问题。
我使用 maven install:install 并将 jar 文件导入到我的本地 maven 存储库中。
然后将此 jar 文件包含在我的 pom.xml 中。
<dependency>
<groupId>com.adsafe</groupId>
<artifactId>common-lib</artifactId>
<version>1.0</version>
</dependency>
所以,该项目编译良好。 (仅供参考......它是一个启用 Maven 的 Eclipse 项目)。但是当我运行该项目时,我收到此 jar 中的其中一个类的 NoClassDefFound 错误。
我的打包是“war”,所以我假设这个 jar 必须与其他 jar 一起放入 WEB-INF/lib 文件夹中,因此它必须位于类路径中。
<packaging>war</packaging>
我哪里错了?
感谢您的帮助!
供参考... 我正在使用 eclipse、m2eclipse(maven 插件),并从 eclipse 中运行它。
I am having issues runtime-resolving a jar file.
I used maven install:install and imported the jar file into my local maven repository.
Then included this jar file in my pom.xml.
<dependency>
<groupId>com.adsafe</groupId>
<artifactId>common-lib</artifactId>
<version>1.0</version>
</dependency>
So, the project compiles fine. (FYI..its a maven enabled eclipse project). but when i run the project i get a NoClassDefFound error for one of the classes inside this jar.
My packaging is 'war', so i assume this jar has to be put into the WEB-INF/lib folder along with the other jars, so it has to be there in the class path.
<packaging>war</packaging>
Where am i going wrong?
Thanks for any help!
FYI...
I am using eclipse, m2eclipse (maven plugin), and running this from within eclipse.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过从命令行运行它?在 Eclipse 中清理你的项目也可能有帮助。
Have you tried running it from the commandline? What also might help is cleaning your project in eclipse.