如何使用m2e-wtp将生成的资源部署到tomcat? [英] How to deploy generated resources to tomcat with m2e-wtp?

查看:496
本文介绍了如何使用m2e-wtp将生成的资源部署到tomcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为构建过程的一部分,我从jar中引用JavaScript。我希望这个js成为部署在tomcat上的应用程序的Web资源的一部分,我已经更新了我的构建过程以允许这种情况发生。做一个maven构建(eclipse外面)按预期的方式工作,我可以按照正确的顺序打包一切的战争。



然而,当使用eclipse构建时,我遇到了有些头痛。我的理解是为了通过增量版本将Web资源部署到tomcat,我需要将这些构建时生成的js文件放入目标/ m2e-wtp / web-resources目录中。但是,当我发布这些新文件被忽略,并且部署到tomcat的Web资源似乎是从我的源头被拉。



我还调整了我的项目的部署程序集设置。通过这个我还没有工作。当我对服务器执行发布时,我有[source:/ target / m2e-wtp / web-resources,DeployPath:/]条目,该文件应该可以找到新生成的文件。然而,同样的事情发生在m2e-wtp似乎从源头上拉出来。



我错过了什么?如何从m2e-wtp获得标准行为(即使它与eclipse之外的构建相当)?或者我可以有日食只是构建战争并部署它(不是增量版本,我可以牺牲一些速度)?



FYI(版本):

tomcat:7.0

以后添加的实验:



删除目标目录后,我执行了一个发布到Tomcat,所有的网络资源都是从我的源头复制的。我还有一个关于没有找到的文件的弹出窗口,其中大部分是编译的类。但是,它正在/ target / m2e-wtp / web-resources / META-INF中查找三个文件。 m2e-wtp插件只能查找文件夹中的特定文件,而不是整个指定的文件夹?

解决方案

问题是目标目录未被刷新。 Eclipse(或者这个事件的m2e插件)在构建期间不能识别或关心目标目录中的文件,这是我假设的。现在我有自动刷新(对于工作区)选项。刷新访问选项不起作用,因为似乎仅在我第一次发布到tomcat时触发刷新。


I am pulling JavaScript from a jar as part of my build process. I wish this js to be part of my web resources for the app deployed on tomcat and I have updated my build process to allow this to happen. Doing a maven build (outside eclipse) works as expected and I can package up a war with everything in its proper order.

However, when building with eclipse I have run into some headaches. My understanding was in order to have web resources deployed to tomcat through an incremental build, I needed to put these build-time generated js files into the target/m2e-wtp/web-resources directory. However, when I publish these new files are ignored and the web-resources deployed to tomcat seem to be pulled from my source.

I also adjusted my project's deployment assembly settings. Through this I still don't have it working. I have the entry [source:/target/m2e-wtp/web-resources, DeployPath:/] which should find the newly generated files when I perform a "publish" to the server. However, the same thing happens where m2e-wtp seems to be pulling from source.

Am I missing something? How can I get standard behavior from m2e-wtp (i.e. make it comparable to a build done outside of eclipse)? Or can I have eclipse just build the war and deploy it as such (not do the incremental builds, I can sacrifice some speed)?

FYI (versions):

eclipse: (Using Spring Tool Suite) 3.2.0
m2e: 1.3.1
m2e-wtp: 0.17.0
tomcat: 7.0

Experiment added later:

After deleting my target dir, I performed a publish to Tomcat and all the web-resources were copied from my source. I also got a popup about files not found, most of which are compiled classes. However, it was looking for three files in the /target/m2e-wtp/web-resources/META-INF. Does the m2e-wtp plugin only look for specific files in a folder rather than the entire specified folder?

解决方案

The problem is that the target directory was not being refreshed. Eclipse (or m2e plugin for that matter) doesn't recognize or care that files change in the target directory during a build, something that I was assuming. For now I have the auto-refresh (for the workspace) option on. The refresh on access option didn't working as it seemed to trigger the refresh only when I was publishing to tomcat for the first time.

这篇关于如何使用m2e-wtp将生成的资源部署到tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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