Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying jhipster app to a different context path

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

like image 607
Maverick Riz Avatar asked Mar 13 '23 21:03

Maverick Riz


1 Answers

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.

like image 181
Maverick Riz Avatar answered Mar 19 '23 11:03

Maverick Riz