使用 m2eclipse 开发 Web 应用程序的首选方式
在开发 Maven Web 应用程序时,我通常使用 jetty-maven-plugin 来快速启动我的应用程序以进行本地测试和调试。使用 m2eclipse
启动的缺点是无法正确包含所有调试源,即使它们是由 Maven 下载的(请参阅 源查找似乎不起作用)。
在 Eclipse 中调试 Maven Web 应用程序的首选方法是什么?我特别欣赏与 gwt-maven-plugin 一起使用的配置。
When developing Maven web applications I usually resort the the jetty-maven-plugin
to quickly launch my application for local testing and debugging. Using the launch with m2eclipse
has the drawback of not properly including all sources for debugging, even though they are downloaded by Maven ( see Source lookup does not seem to work ).
What is the preferred way to debug Maven web applications in Eclipse? I'd especially appreciate configurations which work with the gwt-maven-plugin
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 m2eclipse 开发 Web 应用程序的首选方法是...不使用它。相反,我使用 中描述的方法在 Eclipse 中使用 Maven Jetty 插件进行调试,我在下面引用:
My preferred way to develop web applications with m2eclipse is to... not use it. Instead, I use the approach described in Debugging with the Maven Jetty Plugin in Eclipse that I'm quoting below:
尽量避免编写需要某种容器来调试的代码。始终编写可以独立运行的代码,并将其包装在非常薄的层中进行部署(薄层 -> 几行代码 -> 很少的错误)。
如果您确实必须这样做,请尝试 MockRunner 来模拟应用服务器。
除此之外,您可以在项目属性中手动添加源。
Try to avoid writing code which needs a container of some kind to debug. Always write code that can run independently and wrap it in a very thin layer for deployment (thin layer -> few lines of code -> few bugs).
If you really must, try MockRunner to emulate the app server.
Other than that, you can manually add the sources in the project properties.