title: Are spring-boot command line properties available when using spring-boot:run?
body: <p>The short question:</p>
  
  <p>How can you configure environment profiles, or even just an alternative configuration file name for 
  spring-boot:run?</p>
  
  <p>The long version: </p>
  
  <p>Yes, I read the doc. <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/index.html">http://docs.spring.io/spring-boot/docs/current/reference/html/index.html</a></p>
  
  <p>I have my application configuration settings in src/main/resources/application-mysql.properties:</p>
  
  <pre><code># Specify the DBMS
  spring.jpa.database = MYSQL
  
  # Other Mysql config properties
  
  spring.jpa.hibernate.ddl-auto=create
  </code></pre>
  
  <p>There is a corresponding application-hsql.properties, which contains the same set of configuration options for Hsql.
  There is no application.poperties</p>
  
  <p>There is a corresponding import.sql:</p>
  
  <pre><code>insert into users(name, email) values ('User One',  'one@email.com')
  insert into users(name, email) values ('Two User', 'two@email.com')
  </code></pre>
  
  <p>The unit tests exist only to check for the presence of these users in the repo.</p>
  
  <p>I believe it to be true that whenever the test is run using the MySql configuration, those rows are added to the users table.  When the test is run with hsql, the mysql db should be unaffected.
  I am manually dropping the users table between runs, because I want to manually see when it exists.</p>
  
  <p>1) If I run mvn test, the tests use the configured db:</p>
  
  <pre><code>mvn -Dspring.profiles.active=mysql clean test 
  </code></pre>
  
  <p>Produces mysql database rows and </p>
  
  <pre><code>mvn -Dspring.profiles.active=hsql clean test 
  </code></pre>
  
  <p>Does not.</p>
  
  <p>2) If I make a package, and then run the resulting jar file, I am able to specify a config file name:</p>
  
  <pre><code>java -jar -Dspring.profiles.active=mysql  ./target/app.jar
  </code></pre>
  
  <p>3) If I run with spring-boot:run, only properties in application.properties (which doesn't exist in this test scenario) are discovered.</p>
  
  <pre><code>mvn -Dspring.profiles.active=mysql clean spring-boot:run
  </code></pre>
  
  <p>What does spring-boot:run do differently in launching than running unit tests and kicking off the jar?  The db config is one example, but in theory I'd like to be able to specify a set of dev configs when the application is being run locally vs. a production configuration.</p>