将jhipster应用程序部署到其他上下文路径

将jhipster应用程序部署到其他上下文路径

本文介绍了将jhipster应用程序部署到其他上下文路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用"mvn"命令部署一个jhipster应用程序.我相信这将运行默认的spring-boot:run.我认为这会部署到tomcat.服务器启动后,可以在 http://localhost:8080 上找到应用程序.这很好.但是,我想为应用程序设置上下文路径,我不想将其部署到根目录.

例如: http://localhost:8080/test 会将我带到应用程序索引页面. /p>

我厌倦了以下内容,但没有用.

mvn -Pprod软件包

java -jar target/jhipster-0.0.1-SNAPSHOT.war -Dserver.contextPath =/test

感谢您的帮助.谢谢

解决方案

经过几个小时的搜索和尝试其他操作,我可以为我保证在application-local.yml中设置属性的有效性.

因此在我的application-local.yml文件中,我设置了:

server:
     port: 8080
     contextPath: /test

Spring Boot带有一些预构建的属性支持,可以在application.properties文件中定义.

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.

这篇关于将jhipster应用程序部署到其他上下文路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 01:41