How to add JVM options to program started by mvn spring-boot:run

user8208522 :

What is the best way to add JVM options to the program started by mvn spring-boot:run?

Bohdan Levchenko :

You can configure spring-boot-maven-plugin to always include you jvm options when run:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <jvmArguments>
            -Dapp.name=test
        </jvmArguments>
    </configuration>
</plugin>

Or if you don't need that arguments to stay permanently, use this on the command line:

mvn spring-boot:run -Drun.jvmArguments="..."

Check documentation for details.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=462243&siteId=1