运行jetty而不使用maven 2插件打包项目
我试图在不构建整个项目的情况下运行 jetty,而只需将 jetty 指向目标文件夹下的文件夹。这样做的原因是我希望在为 glassfish 构建应用程序时使用 jetty 作为静态内容服务器。例如,当我对 css 文件进行一点更改时,我不想一直重新部署。
当我使用 maven jetty 插件并运行 jetty:run-exploded 时,它会自动构建项目,包括测试和打包。我希望避免这种情况。
有什么建议吗?
I'm trying to run jetty without building the whole project, but simply point jetty to a folder under the target folder. Reason behind doing this is that I wish to use jetty as a static content server while i build application for glassfish. i don't want to redeploy all the time when i make a little change to a css file, for example.
When I use maven jetty plugin and run jetty:run-exploded, it automatically builds the project including test and package. I wish to avoid that.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关于 jetty:run-exploded,文档说:
因此,您所描述的行为是正常行为,这是有道理的,因为如果尚未构建,jetty 就无法期望在目标下找到某些内容,并且
package
阶段可能涉及诸如过滤之类的事情(因此必须进行过滤)。也就是说,有一些事情可能会有所帮助(我不确定我是否清楚地理解了你的目标,所以我会提到几个选项)。第一个选项,您可以使用
manual
reload 而不是automatic
以避免自动重新部署。关于手动
模式,文档写道:另一种选择是创建另一个“空”war 模块(在 Maven 意义上)来启动 jetty 并使用 jettyConfig 要设置的可选参数:
这样,您应该能够从其他 Web 应用程序部署静态内容。我不认为额外的内容会被“观看”,但如果需要,您可以随时将其与手动模式结合起来。虽然从未测试过。
About jetty:run-exploded, the documentation says:
So the behavior you are describing is the normal behavior and it makes sense as jetty can't expect to find something under target if it hasn't been built and as the
package
phase could involve things like filtering (so filtering must occur).That said, a few things might help (I'm not sure I understood clearly your goal so I'll mention several options). First option, you could use
manual
reload instead ofautomatic
to avoid the automatic redeployment. About themanual
mode, the documentation writes:Another option would be to create another "empty" war modules (in the maven sense) to start jetty from and to use the jettyConfig optional parameter to set:
This way, you should be able to deploy the static content from the other webapp. I don't think that the additional content will be "watched" but you can always combine it with the manual mode if required. Never tested though.