I want to change the httpPort from the default of 8080 for the Jetty Grails plugin. I cannot set the Jetty httpPort property via a system property and/or Gradle property.
System property: gradle jettyRun -DjettyHttpPort=9090
Gradle property (gradle.properties): jettyHttpPort=9090
Right now you have to make a change to your Gradle build script (like adding a configuration task) to make this work. There are JettyPluginConventions with a function to setHttpPort(int) but I do not know how to implement it.
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
I had the same problem, and documentation for Gradle is very general and vague. I sometimes think that only Gradle developers are able to get full potential of this great tool :)
Right now the way is to add following to gradle build script:
jettyRun {
httpPort = 9000
}
It looks you cannot set this value in command line. There was an issue for that, GRADLE-1224, but it was closed as "Won't Fix" because
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.
You can set properties like httpPort via JettyPluginConvention
convention.plugins.jetty.httpPort = 9090
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With