What spring boot version am I using?
It is so easy to learn your spring boot version. To learn that you have to look at the following files (according to project tool you are using): If …
There are 3 ways to change default running port in spring boot application:
By default, the embedded server starts on port 8080.
This is the easiest and fastest way. For the server port we need to change property called server.port
For application.properties file:
server.port=9876
2023-08-07T13:12:17.244+03:00 INFO 24154 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9876 (http) with context path ''
For application.yml file:
server:
port: 9876
You can even further specialized the running port for each environment. For instance if you want your application to run specific port in development, then update the application-dev.properties file:
server.port=9876
We can set the port in the main method as well:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.Collections;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(DemoApplication.class);
app.setDefaultProperties(Collections
.singletonMap("server.port", "9876"));
app.run(args);
}
}
After you create your jar file, you can specify the running port as well:
java -jar spring-application.jar --server.port=9876
It is so easy to learn your spring boot version. To learn that you have to look at the following files (according to project tool you are using): If …
Integrating Google reCAPTCHA v3 with spring boot applications can greatly enhance security and protect against malicious activities, such as spam and …