#Tip to Change port of Spring boot App & Enable Auto build in Eclipse.

To change the port of the Spring boot web app you just need to add the below line inside the main function.

 System.getProperties().put( "server.port", 8083 );  //8083 port is set here
 package hello;

import java.util.Arrays;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

public class Application {
    public static void main(String[] args) {
    	   System.getProperties().put( "server.port", 8083 );  //8083 port is set here
    	   ApplicationContext ctx = SpringApplication.run(Application.class, args);
        System.out.println("Let's inspect the beans provided by Spring Boot:");
        String[] beanNames = ctx.getBeanDefinitionNames();
        for (String beanName : beanNames) {


To Enable autobuild for spring boot app to reflect the changes into the browser from eclipse you just need to make a small update in src/pom.xml

please add the below line into one of the dependency 


Hope this helps

Spring boot Eclipse port rebuild

Leave a Reply

Your email address will not be published. Required fields are marked *