gpt4 book ai didi

grails - 为 Jetty Grails 插件设置 httpPort

转载 作者:行者123 更新时间:2023-12-02 08:17:54 25 4
gpt4 key购买 nike

我想更改 Jetty Grails 插件的默认 httpPort 8080。我无法通过系统属性和/或 Gradle 属性设置 Jetty httpPort 属性。

System property: gradle jettyRun -DjettyHttpPort=9090
Gradle property (gradle.properties): jettyHttpPort=9090

现在您必须对 Gradle 构建脚本进行更改(例如添加配置任务)才能完成此操作。 JettyPluginConventions 有一个 setHttpPort(int) 的函数,但我不知道如何实现它。

http://www.gradle.org/releases/1.0-milestone-3/docs/javadoc/org/gradle/api/plugins/jetty/JettyPluginConvention.html#setHttpPort(java.lang.Integer)

http://www.gradle.org/jetty_plugin.html

最佳答案

我也遇到了同样的问题,Gradle 的文档非常笼统且模糊。我有时认为只有 Gradle 开发人员才能充分发挥这个伟大工具的潜力:)

现在的方法是将以下内容添加到 gradle 构建脚本中:

jettyRun {
httpPort = 9000
}

看来您无法在命令行中设置此值。有一个问题,GRADLE-1224 ,但它被关闭为“无法修复”,因为

The Jetty plugin has been deprecated and is scheduled to be removed with Gradle 4.0. We are not going to work on this issue anymore.

关于grails - 为 Jetty Grails 插件设置 httpPort,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6767732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com