Deploying jhipster app to a different context path

只愿长相守 提交于 2019-12-10 17:12:59

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/36064885/deploying-jhipster-app-to-a-different-context-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!