3

Does anybody know if there is an easy way to override the gretty, or any gradle configuration on the command line?

(the ones here: http://akhikhl.github.io/gretty-doc/Gretty-configuration.html)

I have tried this

gradle -Dgretty.httpPort=8111 :web:jettyRun

but it still runs on port 8080.

Alex028502
  • 3,486
  • 2
  • 23
  • 50

1 Answers1

2

You can configure it like below,

gretty {
   if(project.hasProperty('portNumber')){ // if variable passed use it
       httpPort=Integer.parseInt(portNumber)
   }
   else{ // if it is not passed use a default port
      httpPort=8080
   }
...
}

And when you want to use a specific port gradle ... -PportNumber=8111

miskender
  • 7,460
  • 1
  • 19
  • 23