user8208522
user8208522

Reputation:

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

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

Upvotes: 19

Views: 22186

Answers (2)

jozinho22
jozinho22

Reputation: 592

Now it is:

mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

Upvotes: 13

Bohdan Levchenko
Bohdan Levchenko

Reputation: 3561

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.

Upvotes: 22

Related Questions