I currently working on an Spring Boot application written in Java 8 using Gradle. What I am looking for is to pass as an argument the server port when running the Jar from the command line.
For example:
java -jar myApplication.jar --port=8888
: This runs my Spring boot application using port8888
java -jar myApplication.jar
: Since no port number is passed as argument, the spring boot application should run on a default port number (let's say8080
)
Can anyone help me with this ?