Spring Boot comes with some pre-installed property support. If you create an application.properties file, you can include:
server.port=<another port> server.address=<another IP address> server.sessionTimeout=<another timeout setting> server.contextPath=/your-other-path
This can be in application.properties next to your executable JAR embedded in the JAR file, or simply applied as -Dserver.contextPath = / your-alt-path with the java command. They cascade, that is, you can insert one set of default values ββinto the JAR, override using the local application.properties file, and then finally override application.properties using the -D options.
source share