【问题标题】:Gradle jettyRun doesn't stop in intelliJGradle jettyRun 不会在 intelliJ 中停止
【发布时间】:2014-07-07 17:30:59
【问题描述】:

我们有一个 Maven 项目,它在 IntelliJ 中完美地使用了 JettyRun,我的意思是您将开始构建,甚至调试,然后停止构建(使用红色按钮),它也会停止 jetty。

我们不得不迁移到 Gradle,并考虑使用 gradle JettyRun 插件,但它的工作方式不同。事实上,如果你停止构建,码头将继续在后台运行,我必须从终端手动终止它。

配置很简单:

apply plugin: 'jetty'

...

jettyRun {
    contextPath = ""
}

有没有人知道如何拥有老行家的行为?

【问题讨论】:

    标签: intellij-idea gradle jetty intellij-13


    【解决方案1】:

    我自己找到了解决方案(有点):jetty 插件确实有一个jettyStop 任务,它肯定会终止服务器。

    为了实现自动化(编辑:感谢 dschulz):

    stopPort = 9123
    stopKey = "jjj" //whatever you prefere
    //Stops the jetty Instace when restarting (instance has to be stopped manually otherwise, with jettyStop)
    jettyRun, jettyRunWar]*.daemon = true
    [jettyRun, jettyRunWar].each { jetty ->
        jetty.dependsOn jettyStop
    }
    

    【讨论】:

    • 我刚试过这个,它没有按预期工作。但是,我删除了jetty.dependsOn << jettyStop 中的<< 部分,现在它工作正常。感谢分享。
    • 哦,我也需要这个:[jettyRun, jettyRunWar]*.daemon = true。否则无法从 IntelliJ 中阻止 Jetty。
    猜你喜欢
    • 2013-05-13
    • 1970-01-01
    • 1970-01-01
    • 2016-08-16
    • 2015-05-16
    • 2017-09-04
    • 2015-07-17
    • 2014-10-29
    • 1970-01-01
    相关资源
    最近更新 更多