1、设置Configurations



2、修改application.java启动文件

@SpringBootApplication
@EnableEurekaClient
public class EurekaService1Application {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String port = scanner.nextLine();
		new SpringApplicationBuilder(EurekaService1Application.class)
				.properties("server.port=" + port).run(args);
	}
//	public static void main(String[] args) {
//		SpringApplication.run(EurekaService1Application.class, args);
//	}
}
3、运行项目



再次启动项目




Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐