Maven工作空间解析缺少用于本地Tomcat测试的jar [英] Maven workspace resolution missing jars for local Tomcat testing

查看:141
本文介绍了Maven工作空间解析缺少用于本地Tomcat测试的jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目化项目,该项目依赖于我的团队当前正在研究的其他4个项目化项目.我们启用了工作空间解析".

I have a mavenized project with dependencies upon 4 others mavenized projects that my team is currently working on. We have "workspace resolution" enabled.

如果我发布到Tomcat,则jar不适用于4个项目,因此我会看到各种NoClassDefFoundError异常. 我看不到JUnit测试或打包有任何问题. (我运行了包装目标,并且产生的war文件包含了我期望的SNAPSHOT罐子.)

If I publish to Tomcat, jars are not available for the 4 projects so I see all sorts of NoClassDefFoundError exceptions. I don't see any problems with JUnit testing or packaging. (I run the package goal and the resulting war file includes the SNAPSHOT jars that I expect.)

我看到很多人主张使用工作空间分辨率,但是如果我们需要在T​​omcat中进行测试,是否应该禁用此功能?还是我可能还会缺少什么?

I see a lot of people advocating for using workspace resolution, but if we need to test in Tomcat should we disable this? Or what else might I be missing?

我们使用m2eclipse插件Eclipse Helios Maven 3.0.3.我什至安装了m2extras来查看是否有帮助,但没有发现任何区别.

We use Eclipse Helios, the m2eclipse plugin, Maven 3.0.3. I even installed m2extras to see if that helped, but I didn't see any difference.

谢谢

推荐答案

如果可以的话,您可以使用此设置(我们一直在使用相同的工具链并在此处进行设置)使用m2eclipse目标建立后,手动刷新.

You can get this setup to work (we have been working with the same toolchain and setup here) if you can live with some manual refreshes, after you have been using m2eclipse goals to build.

问题是,并非通过m2eclipse构建到工作区项目的所有外部更改都正确地同步到了您在tomcat中部署的Web应用程序.

The problem is, that not all external changes via m2eclipse builds to workspace projects are synched correctly to your deployed web application in tomcat.

因此,如果通过m2eclipse构建后遇到NoClassDefFoundError异常,则以下内容应会有所帮助(并非每次都必要):

So if you are experiencing NoClassDefFoundError exceptions after building via m2eclipse the following should help (not all are necessary everytime):

  • 在您的maven项目中执行项目/清理
  • 对Maven项目进行刷新(F5)
  • 清理部署的Web应用程序(服务器上下文"菜单)

是的,它很麻烦,但可以忍受它.

Yes, it is cumbersome but one can live with it.

这篇关于Maven工作空间解析缺少用于本地Tomcat测试的jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆