I am trying to deploy a jhipster app using 'mvn' command. I believe this will run the default spring-boot:run. I think this deploys to tomcat. Once the server start's the application is availabe at http://localhost:8080. This works fine. But, i want to set a context path to the application, i don't want to deploy it to the root.
For example: http://localhost:8080/test should take me to the application index page.
I tired the following, but it did not work.
mvn -Pprod package
java -jar target/jhipster-0.0.1-SNAPSHOT.war -Dserver.contextPath=/test
Any help is appreciated. Thanks
After few hours of googling and trying different things, I can vouch for the effectiveness of setting the property in application-local.yml
for me.
So in my application-local.yml
file, I set:
server:
port: 8080
contextPath: /test
Spring Boot comes with some pre-built property support, which can be defined in application.properties
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With