Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure jhipster app to run on different port when launching with maven

Jhipster docs say you have to

mvn -Pprod package

and then you can execute the generated war with

java -jar jhipster-0.0.1-SNAPSHOT.war --spring.profiles.active=prod

you may configure the server port with

java -jar jhipster-0.0.1-SNAPSHOT.war --spring.profiles.active=prod --server.port=9000

as per the Spring Boot docs specify that command line arguments take precedence over application properties files and YAML variants.

But, when trying to run the app with maven on a different port

mvn -Pprod -Dserver.port=9000 spring-boot:run

it still reads the server.port from application-prod.yml

like image 311
cirovladimir Avatar asked Dec 09 '25 18:12

cirovladimir


1 Answers

mvn -Pprod spring-boot:run -Drun.arguments="--server.port=9000,--spring.profiles.active=prod"

like image 104
sdoxsee Avatar answered Dec 11 '25 12:12

sdoxsee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!