简体   繁体   English

如何从Eclipse(ScalaIDE插件)运行play2 Web应用程序

[英]How to run play2 web application from Eclipse ( ScalaIDE plugin )

I am using Eclipse Juno with Scala plugin. 我正在使用带有Scala插件的Eclipse Juno。 As of now to work with play2 web application I have to first fire terminal and execute play debug ~run ( or play run if I don't want to debug ), and then I can work in Eclipse and after each save play does it job of deploying the code again to jetty. 截至目前,与play2 Web应用程序工作,我必须先火终端和执行play debug ~run (或者play run ,如果我不想调试),然后我可以在Eclipse工作后每次保存play做它的工作再次将代码部署到码头。

Can I somehow skip this terminal step? 我可以以某种方式跳过此终端步骤吗? I just want to run the web app from Eclipse. 我只想从Eclipse运行Web应用程序。 For J2EE web application, Eclipse have nice server integration. 对于J2EE Web应用程序,Eclipse具有良好的服务器集成。 We can deploy and run the application from Eclipse to tomcat ( or any other server ) easily. 我们可以轻松地将应用程序从Eclipse部署并运行到tomcat(或任何其他服务器)。 Is there something similar for Play2? Play2有类似的东西吗?

To my knowledge, there is no way to skip this step. 据我所知,没有办法跳过这一步。 I have spent some time looking for this over the last few weeks with no luck. 在过去的几周里,我花了一些时间没有运气。 My co-worker, who has been working with play for several months, isn't aware of any tools either. 我的同事已经玩了几个月的游戏,也不知道有任何工具。

This is not a solution, but a slightly more efficient method - I have a windows batch file (for linux, use a script) in my eclipse project that starts the play server - at least you don't have to leave eclipse and hit the command line by hand. 这不是解决方案,而是一种稍微有效的方法-我在eclipse项目中有一个Windows批处理文件(对于Linux,使用脚本),该文件可启动播放服务器-至少您不必离开Eclipse并点击手动命令行。 No real difference to starting a tomcat server from eclipse for a java war project. 对于Java war项目,从eclipse启动tomcat服务器没有真正的区别。 This batch also starts chrome browser after waiting for 10s (just enough time for the play server to come up) and points to the server url 该批处理还会在等待10秒(刚好足够播放服务器启动的时间)后启动chrome浏览器,并指向服务器网址

the batch file contents - obviously, change your paths... 批处理文件的内容-显然,更改路径...

echo off 回声

cd\\eclipse\\workspace\\testApp cd \\ eclipse \\ workspace \\ testApp

start play run 开始播放

timeout 10 超时10

start chrome http://{server_url}:9000 开始浏览器http:// {server_url}:9000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM