How to configure multiple instances of SpringBoot project to run on different ports in IDEA

1 Problem Scenario

When we develop a new project, we may hope that testers can help me run some unit test cases after completing a new module function and passing the self-test, but we need to develop technology on this basis. New function, this is why we need to run multiple instances at the same time on our development PC to ensure the needs of development and internal testing. Let’s talk about how to implement this multi-instance running of the same project on IDEA.

2 Environment preparation

  • JDK 1.8
  • IDEA 2021.3.2

3 Configuration process

3.1 Running instance configuration

Modify the startup configuration of the current project
Insert image description here
Set the project instance name
Insert image description here
Enable multi-instance configuration
Insert image description here
Set the current instance's Running port
Insert image description here
Copy the current instance
Insert image description here
Modify the name and running port of the copied instance
Insert image description here

3.2 Set up the runtime group

Create a new running group
Insert image description here
Insert image description here
Modify the name of the running group and the startup instance in the running group
Insert image description here

3.3 Run group startup test

After the above operations, the configuration is basically complete. Let’s run it here to see if both services can run normally.
Insert image description here
AppRun-8009 started successfully
Insert image description here
AppRun-8010 started successfully
Insert image description here

OK, the configuration is over, and then let the test be performed on port 8010. We can continue to develop new business module functions on port 8009, and the matching will not affect each other. Of course, normally we should package it into a test environment to provide a stable environment for testers to conduct testing. We are only transferring tests internally and have not yet reached the integration stage. It is just a solution that can allow testers to intervene in the project as early as possible. Each company may have different requirements for project management, so just adjust it according to the actual situation.

Guess you like

Origin blog.csdn.net/qq_41865652/article/details/129083114