title: Specifying Spring profile on command line in Spring Boot Multimodule Mave project
body: <p>I've got <a href="https://github.com/RichardBenes/spring-profile-issues" rel="nofollow noreferrer">this</a> multi-module Spring Boot (v2.7.0) project.
  It's fairly bare-bone - one Controller with one endpoint.</p>
  <pre><code>├───app
  │   ├── pom.xml
  │   └───src
  │       └───main
  │           └───java
  │               └───com
  │                   └───rb
  │                       └─── App.java
  ├───controller
  │   ├── pom.xml
  │   └───src
  │       └───main
  │           └───java
  │               └───com
  │                   └───rb
  │                       └─── MainController.java
  └ pom.xml
  </code></pre>
  <p>I'm using Maven 3.8.4.</p>
  <p>I would like to specify profile on the command line using this <a href="https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/#run.examples.specify-active-profiles" rel="nofollow noreferrer">Spring Boot's nice shortcut</a>:</p>
  <pre><code>mvn clean install; 
  mvn spring-boot:run '-Dspring-boot.run.profiles=local' --projects app
  </code></pre>
  <p><em>(I'm running it from PowerShell, hence the single quotes around the parameter)</em></p>
  <p>However, it doesn't work. The app starts, runs fine, but with the <code>default</code> profile.</p>
  <p><strong>My question is - how to make this nice syntax work, or why does it not work?</strong></p>
  <p>This uglier <a href="https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/#run" rel="nofollow noreferrer">longer syntax</a> mentioned in Spring's works:</p>
  <pre><code>mvn clean install;
  mvn spring-boot:run '-Dspring-boot.run.jvmArguments=&quot;-Dspring.profiles.active=local&quot;' --projects app
  </code></pre>
  <p>I also tried running it on Command Prompt omitting those single-quotes - with the same result.</p>
  <p>I would appreciate any insights on what could be the issue - I'm no expert in Java's
  properties &amp; command-line arguments.</p>