How to start multiple SpringBoot service instances in idea (optimal solution)

1. IDEA version

Different versions may have different settings, but the implementation principles are the same.
insert image description here

2. Implementation ideas

Starting the SpringBoot project is actually starting service containers such as Tomcat. Starting Tomcat requires a communication port. As long as the port is different, multiple service instances can be started, and then configure multiple SpringBoot applications through the Edit Configurations of the Idea tool to set different ports. .

3. Implementation process

1. Configure the SpringBoot service plug-in (you can skip it if you have already configured it)

insert image description here
Add SpringBoot plugin
insert image description here
insert image description here
insert image description here

After configuring and starting, you can see it here

insert image description here

2. Edit Configurations of the Idea tool configures multiple SpringBoot applications

insert image description here
insert image description here
insert image description here

2. Set the JVM startup parameters to specify the port used to start Tomcat

// 设置使用随机端口,也可以自己指定
-Dserver.port=0

insert image description here

3. Start the project

insert image description here

Guess you like

Origin blog.csdn.net/weixin_44606481/article/details/132694434