title: Running maven goals clean install in Intellij IDEA getting error Invalid initial heap size: -Xms=256m
body: <p>I'm running Maven clean install from IntelliJ IDEA 2019.3.21 and it's terminated almost immediately after starting it: </p>
  
  <pre><code>"C:\Program Files\Java\jdk1.8.0_231\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\beniregev\workspace\tool-elastic-search-injector -Xms=256m -Xmx512m "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\lib\idea_rt.jar=53516:C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar" org.codehaus.classworlds.Launcher -Didea.version2019.3.2 clean install
  
  Error: Could not create the Java Virtual Machine.
  Error: A fatal exception has occurred. Program will exit.
  Invalid initial heap size: -Xms=256m
  </code></pre>
  
  <p>Here's the <strong>m2.conf</strong>:</p>
  
  <pre><code>main is org.apache.maven.cli.MavenCli from plexus.core
  
  set maven.conf default ${maven.home}/conf
  
  [plexus.core]
  load       ${maven.conf}/logging
  optionally ${maven.home}/lib/ext/*.jar
  load       ${maven.home}/lib/*.jar
  </code></pre>
  
  <p>And here's my <strong>pom.xml</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;spring-cloud.version&gt;Greenwich.RELEASE&lt;/spring-cloud.version&gt;
          &lt;swagger-annotations.version&gt;1.5.20&lt;/swagger-annotations.version&gt;
          &lt;swagger-plugin.version&gt;3.1.7&lt;/swagger-plugin.version&gt;
          &lt;springfox.swagger2.version&gt;2.9.2&lt;/springfox.swagger2.version&gt;
          &lt;junit-jupiter-api.version&gt;5.1.0&lt;/junit-jupiter-api.version&gt;
          &lt;mockito-core.version&gt;2.23.4&lt;/mockito-core.version&gt;
          &lt;logstash-logback-encoder.version&gt;5.3&lt;/logstash-logback-encoder.version&gt;
          &lt;logback.version&gt;1.2.3&lt;/logback.version&gt;
          &lt;android-json.version&gt;0.0.20131108.vaadin1&lt;/android-json.version&gt;
          &lt;lib-logging.version&gt;1.0.0-SNAPSHOT&lt;/lib-logging.version&gt;
      &lt;/properties&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.1.2.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt;
      &lt;/parent&gt;
  
      &lt;groupId&gt;com.beniregev.apps&lt;/groupId&gt;
      &lt;artifactId&gt;search-injector&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  
      &lt;dependencies&gt;
          &lt;!-- V10 depedencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.beniregev.apps&lt;/groupId&gt;
              &lt;artifactId&gt;lib-logging&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
              &lt;version&gt;${mockito-core.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-api&lt;/artifactId&gt;
              &lt;version&gt;${junit-jupiter-api.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vaadin.external.google&lt;/groupId&gt;
              &lt;artifactId&gt;android-json&lt;/artifactId&gt;
              &lt;version&gt;${android-json.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.logstash.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logstash-logback-encoder&lt;/artifactId&gt;
              &lt;version&gt;${logstash-logback-encoder.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-core&lt;/artifactId&gt;
              &lt;version&gt;${logback.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
              &lt;version&gt;${logback.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.swagger&lt;/groupId&gt;
              &lt;artifactId&gt;swagger-annotations&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.springfox&lt;/groupId&gt;
              &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
              &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
              &lt;version&gt;4.5.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.rabbitmq&lt;/groupId&gt;
              &lt;artifactId&gt;amqp-client&lt;/artifactId&gt;
              &lt;version&gt;5.7.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.swagger&lt;/groupId&gt;
              &lt;artifactId&gt;swagger-annotations&lt;/artifactId&gt;
              &lt;version&gt;${swagger-annotations.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.springfox&lt;/groupId&gt;
              &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
              &lt;version&gt;${springfox.swagger2.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.beniregev.apps&lt;/groupId&gt;
              &lt;artifactId&gt;lib-logging&lt;/artifactId&gt;
              &lt;version&gt;${lib-logging.version}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;!-- Build an executable JAR --&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                              &lt;classpathPrefix&gt;lib/&lt;/classpathPrefix&gt;
                              &lt;mainClass&gt;com.beniregev.apps.injector.Main&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>I have looked all over my application and don't have anywhere where I set the JVM heap with Xms or Xmx. Also, setting Xms and Xmx should be like <code>-Xms256m</code> and <code>-Xmx512m</code> not as it's shown in the command generated by <em>IntelliJ</em>. </p>
  
  <p>Where and how does <em>IntelliJ</em> generates this line??</p>
  
  <p>I have the same error when trying to build other applications with <code>mvn clean install</code>. </p>
  
  <p>I created a new <em>Spring Boot</em> application and used <em>IntelliJ</em> to build it with <code>mvn clean install</code> -- it was built without errors.</p>
  
  <p>I cloned my project to a completely new folder <code>c:\beniregev\workspace\tools-elastic-search-injector</code>, the original folder was <code>c:\development\JavaProjects\IdeaProjects\tools-elastic-search-injector</code>.</p>
  
  <p>I've checked the Settings before posting this question. Also verified I don't have <code>JAVA_OPTIONS</code> in the Environment on my machine.</p>
  
  <p>I need to change <code>-Xms=256m</code> to <code>-Xms256m</code> -- where do I do that? Looks like IntelliJ has a default or value is set somewhere.</p>
  
  <p>What am I missing? What else I need to check? Any other Settings/Variables that I missed?</p>
  
  <p>Running <code>"C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\plugins\maven\lib\maven3\bin\mvn" clean install</code> produce the same error:</p>
  
  <p><a href="https://i.stack.imgur.com/7Vt0j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Vt0j.png" alt="enter image description here"></a></p>