title: How to debug a spring boot app in VS Code with command line arguments?
body: <p>I've tried to create a VS Code launch configuration which passes command line arguments to a Spring Boot app.</p>
  <pre><code>@SpringBootApplication
  public class DemoApplication {
  
      public static void main(String[] args) {
  
          for (String arg : args) {
              System.out.println(arg);
          }
          SpringApplication.run(DemoApplication.class, args);
      }
  
  }
  </code></pre>
  <pre><code>&quot;configurations&quot;: [
     {
        &quot;type&quot;: &quot;java&quot;,
        &quot;name&quot;: &quot;CodeLens (Launch) - DemoApplication&quot;,
        &quot;request&quot;: &quot;launch&quot;,
        &quot;mainClass&quot;: &quot;com.jackdry.processors.kafkalz4_compress.DemoApplication&quot;,
        &quot;projectName&quot;: &quot;kafka-lz4_compress&quot;,
        &quot;vmArgs&quot;: &quot;-Dspring-boot.run.arguments=-color=red&quot;
      }
    ]
  </code></pre>
  <p>But when I press &quot;Debug&quot; in VSCode, <code>-color=red</code> isn't being printed. Can anybody help?</p>
  <p>If useful, the command which &quot;Debug&quot; actually invokes is:</p>
  <pre><code>cd /home/jack/jackdry/processors/kafka-lz4_compress ; /usr/lib/jvm/java-11-openjdk-amd64/bin/java -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:38675 -Dspring-boot.run.arguments=-color=red -Dfile.encoding=UTF-8 @/tmp/cp_3noz6bed0u43t5tl3jj9cqoel.argfile com.jackdry.processors.kafkalz4_compress.DemoApplication 
  </code></pre>