Gradle embedded jetty plugin is not stopping automatically

拟墨画扇 提交于 2019-12-04 18:44:39

In 2) try setting the stopPort to something else, such as 8090.

I think you are actually running jetty on 8080 so that port will be occupied and you are unable to set up a 'stop' listener.

Otherwise you can just put the following in your build.gradle

// need to set the stopPort and stopKey so we are able to stop jetty!
jettyRunWar.stopPort = 8090
jettyRunWar.stopKey = 'stopKey'
jettyStop.stopPort = 8090
jettyStop.stopKey = 'stopKey'

Here is an example that worked for me in intelliJ http://pastebin.com/eTtvCdTb

I run 'jettyRunWar' and 'jettyStop' from the Gradle tasks panel in intelliJ. I've only set the parameters up for jettyRun just in case I run that task by accident, I can then shut the server down.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!