Maven plugin (spring-boot:run) should take list for JVM arguments
See original GitHub issueProblem: It is too easy to break spring-boot:run
by passing in garbage in the <jvmArguments>
configuration. Currently it looks like this (not a list):
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>any kind of garbage</jvmArguments>
</configuration>
</plugin>
Solution: The Maven plugin should allow passing in Java (JVM) system properties via some kind of list definition in XML.
Example solution:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
<options>
<option>-Xms512m</option>
<option>-Xmx1024m</option>
</options>
<systemProperties>
<systemProperty>systemProperty1=value1</systemProperty>
<systemProperty>systemProperty2=value2</systemProperty>
</systemProperties>
</jvmArguments>
</configuration>
</plugin>
where each <option>
is passed in as-is to the JVM, and each <systemProperty>
is pre-pended with a -D
:
-Xms512m -Xmx1024m -DsystemProperty1=value1 -DsystemProperty2=value2
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Spring Boot Maven Plugin – spring-boot:run
JVM arguments that should be associated with the forked process used to run the application. On command line, make sure to wrap multiple...
Read more >How to add JVM options to program started by mvn spring ...
You can configure spring-boot-maven-plugin to always include you jvm options when run: <plugin> <groupId>org.springframework.boot</groupId> ...
Read more >Command-line Arguments in Spring Boot - Baeldung
First, let's see how we can pass arguments while running our application using Maven Plugin. Later, we'll see how to access the arguments...
Read more >Maven cheatsheet
As a example I will use the Spring boot plugin. The project you can easily ... jvmArguments User property: spring-boot.run.jvmArguments JVM ...
Read more >IntelliJ IDEA - Spring Boot run configuration - JetBrains
Save the run configuration settings to a file that you can share with other team members. The default location is .idea/runConfigurations. However, if...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@vadeg i’m not a fan of “listing” elements like that in XML, my preference is that element lists should be clean looking whereby the top-level element is the plural word of what the list is, and each element is the singular word, example:
even Spring uses this approach! https://www.tutorialspoint.com/spring/spring_injecting_collection.htm
Closing in favour of PR #10741