Search code examples
javaspringintellij-ideacmdarguments

How to add a command line argument to to a Run Configuration in Intelij?


How do I add a command line argument to my Spring boot application when using Intelij.

My command when I open edit configurations is currently: spring-boot:run:

enter image description here

I would like to add a command line arg after this.

For reference my main class extends implements CommandLineRunner


Solution

  • in your edit configuration you select the spring boot application and there you can fill in the program arguments... see screenshot of Application Arguments Configuration.

    enter image description here

    This is the spring boot configuration