I use Spring Boot with Gradle, I execute this in Intelij:
10:43:37: Executing external task 'bootRun -Drun.arguments="--
server.port=6666"'...
but still in logs I see:
Tomcat initialized with port(s): 8080 (http)
I have seen this, but it does not work for me: https://stackoverflow.com/a/37053004/3871754
Using Command Line Arguments with the Spring Gradle BootRun task isn't readily apparent. Here is a very interesting discussion on the topic in this Spring Boot Issue Thread.
How you can do it today is by passing all system properties to the bootRun task as mentioned in the thread, like this.
bootRun {
systemProperties = System.properties
}
Then you can use simply:
bootRun -Dserver.port=6666
s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 6666 (http)
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