IDEA下如何多次运行同一个springboot项目
1、设置Configurations2、修改application.java启动文件@SpringBootApplication@EnableEurekaClientpublic class EurekaService1Application {public static void main(String[] args) {Scanner scanner =
·
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、运行项目
再次启动项目
更多推荐
已为社区贡献5条内容
所有评论(0)