title: How to configure jhipster app to run on different port when launching with maven
body: <p><a href="http://jhipster.github.io/production.html" rel="nofollow">Jhipster docs</a> say you have to</p>
  
  <p><code>mvn -Pprod package</code></p>
  
  <p>and then you can execute the generated war with</p>
  
  <p><code>java -jar jhipster-0.0.1-SNAPSHOT.war --spring.profiles.active=prod</code></p>
  
  <p>you may configure the server port with</p>
  
  <p><code>java -jar jhipster-0.0.1-SNAPSHOT.war --spring.profiles.active=prod --server.port=9000</code></p>
  
  <p>as per the <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html" rel="nofollow">Spring Boot docs</a> specify that command line arguments take precedence over application properties files and YAML variants.</p>
  
  <p>But, when trying to <strong>run the app with maven on a different port</strong></p>
  
  <blockquote>
    <p><code>mvn -Pprod -Dserver.port=9000 spring-boot:run</code></p>
  </blockquote>
  
  <p>it <strong>still reads the server.port from application-prod.yml</strong></p>