如何从 Eclipse 停止 Jetty 服务器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8707046/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to stop Jetty server from eclipse
提问by Shahjalal
I am using Eclipse with Maven. In my pom file i used following Jetty plugin to use as a deployment server. Now I have two problem
我在 Maven 中使用 Eclipse。在我的 pom 文件中,我使用了以下 Jetty 插件作为部署服务器。现在我有两个问题
I can run this Jetty Server from Run As > Maven Build... > jetty:run But I do now know how to stop this server. After closing Eclipse if i go to http://localhost:8080. then i see this jetty server still running.
After deploying first project, if I start to work with second project then i can not deploy my second project on jetty. I followed the same process as before, but it does not work.
我可以从 Run As > Maven Build... > jetty:run 运行这个 Jetty Server 但我现在知道如何停止这个服务器。关闭 Eclipse 后,如果我转到http://localhost:8080。然后我看到这个码头服务器仍在运行。
部署第一个项目后,如果我开始使用第二个项目,那么我无法在码头上部署我的第二个项目。我遵循了与以前相同的过程,但它不起作用。
Note: I am a new user of Maven and Jetty
注:我是Maven和Jetty的新用户
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>foo</stopKey>
</configuration>
</plugin>
回答by stevek
You can stop the Jetty server in the Maven Plugin, easily, no need to install more software.
您可以在 Maven Plugin 中轻松停止 Jetty 服务器,无需安装更多软件。
1) Open the console (the panel usually docked on the right hand side of Eclipse)
2) Click Red Square (the Stop Button) for every Jetty Instance that is running
1) 打开控制台(面板通常停靠在 Eclipse 的右侧)
2)为每个正在运行的 Jetty 实例单击红色方块(停止按钮)
回答by Shahjalal
By the way. I solved my problem. after a little searching i got run-jetty-run(http://code.google.com/p/run-jetty-run) for eclipse. everything is very easy with it. After using this one i can say this is better then the jetty plugin in maven.
顺便一提。我解决了我的问题。经过一番搜索,我得到了 eclipse 的run-jetty-run(http://code.google.com/p/run-jetty-run)。有了它,一切都很容易。在使用了这个之后,我可以说这比 maven 中的 jetty 插件更好。