SpringBoot's configuration of Run/Debug Configurations in IntelliJ IDEA

Running a Spring Boot multi-module application

Start with SpringBoot configuration:

Use classpath of module to select the module to run

VM options: Internal configuration parameters

Start with maven:

The jvm parameter configuration of different versions of spring-boot-maven-plugin is different, and the parameters are also different from starting the springboot program through the main method.

When running the main method, it can be passed by adding the -D parameter after java -jar, for example:

java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 huishi-api-implementation.jar

pom.xml file configuration:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
                </configuration>
            </plugin>
        </plugins>
    </build>

At this point, running spring-boot:run can pass parameters normally. But at this time, the parameters are passed through the mvn spring-boot:run command, and the parameter values ​​will be invalid.

Similarly, even if the above plugin is configured in the pom file of the project and started directly through the main method, this parameter will not take effect. When packaging and deploying, you still need to add parameter items to the execution command.

To change the file in this way, it is more troublesome to submit, and I don't like it very much.

http://blog.hanqunfeng.com/2016/12/09/spring-boot-study/

https://blog.csdn.net/wo541075754/article/details/75017014

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324767210&siteId=291194637