title: How to set system property when running a spring boot app in intellij?
body: <p>I want to set a system property when running a spring boot application in IntelliJ, and then get it in my program. I am using IntelliJ Idea CE.</p>
  <p>Initially I tried in a normal Java project (not spring or maven). I just set the value in &quot;VM Options&quot; in run configurations (Ex: -DpropertyName=propertyValue). And then I ran the main function, I was able to access it by <code>System.getProperty(&quot;propertyName&quot;)</code>.</p>
  <p>Now I want to do the same with my spring boot project. Its packaging is war. As I am using Community Edition, I run the project by running the maven command spring-boot:run. How do I pass a system property here?</p>
  <p>I have tried adding the property in &quot;VM Options&quot; in the run configuration.</p>
  <p>I have tried below commands -</p>
  <pre><code>spring-boot:run -DpropertyName=propertyValue
  
  spring-boot:run --propertyName=propertyValue
  
  spring-boot:run -Drun.jvmArguments=&quot;-DpropertyName=propertyValue&quot;
  </code></pre>
  <p>But in all approaches, when I am getting the property value in my method, it gives null.</p>
  <p>Any suggestions are welcome.</p>
  <p><strong>EDIT</strong> Adding code snipped as requested</p>
  <pre><code>public static boolean isSomething() {
      return !StringUtils.equals(System.getProperty(&quot;propertyName&quot;), Constants.CONSTANT_VALUE);
  }
  </code></pre>