我正在尝试将Jhipster Gateway(5.0 - springboot 2.0)作为可执行战争运行。
根据https://www.jhipster.tech/production/和https://www.jhipster.tech/profiles/,我有:
mvn -Pprod package
通过以下目录成功构建战争:
META-INF/
org/
org/springframework/
org/springframework/boot/
org/springframework/boot/loader/
org/springframework/boot/loader/util/
org/springframework/boot/loader/jar/
org/springframework/boot/loader/archive/
org/springframework/boot/loader/data/
app/
content/
i18n/
swagger-ui/
swagger-ui/dist/
swagger-ui/dist/css/
swagger-ui/dist/images/
swagger-ui/dist/lib/
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/com/
WEB-INF/classes/com/cheetah/
WEB-INF/classes/com/cheetah/gateway/
WEB-INF/classes/com/cheetah/gateway/aop/
WEB-INF/classes/com/cheetah/gateway/aop/logging/
WEB-INF/classes/com/cheetah/gateway/client/
WEB-INF/classes/com/cheetah/gateway/config/
WEB-INF/classes/com/cheetah/gateway/config/apidoc/
WEB-INF/classes/com/cheetah/gateway/config/audit/
WEB-INF/classes/com/cheetah/gateway/config/ssl/
WEB-INF/classes/com/cheetah/gateway/domain/
WEB-INF/classes/com/cheetah/gateway/gateway/
WEB-INF/classes/com/cheetah/gateway/gateway/accesscontrol/
WEB-INF/classes/com/cheetah/gateway/gateway/ratelimiting/
WEB-INF/classes/com/cheetah/gateway/gateway/responserewriting/
WEB-INF/classes/com/cheetah/gateway/repository/
WEB-INF/classes/com/cheetah/gateway/security/
WEB-INF/classes/com/cheetah/gateway/security/oauth2/
WEB-INF/classes/com/cheetah/gateway/service/
WEB-INF/classes/com/cheetah/gateway/service/dto/
WEB-INF/classes/com/cheetah/gateway/service/mapper/
WEB-INF/classes/com/cheetah/gateway/web/
WEB-INF/classes/com/cheetah/gateway/web/rest/
WEB-INF/classes/com/cheetah/gateway/web/rest/errors/
WEB-INF/classes/com/cheetah/gateway/web/rest/util/
WEB-INF/classes/com/cheetah/gateway/web/rest/vm/
WEB-INF/classes/config/
WEB-INF/classes/config/liquibase/
WEB-INF/classes/config/liquibase/changelog/
WEB-INF/classes/i18n/
WEB-INF/classes/META-INF/
WEB-INF/classes/templates/
WEB-INF/lib/
META-INF/maven/
META-INF/maven/com.cheetah.gateway/
META-INF/maven/com.cheetah.gateway/gateway/
WEB-INF/lib-provided/
应用程序日志显示它成功启动(服务在7000上运行)
java -jar gateway-0.0.1-SNAPSHOT.war --spring.profiles.active = prod
---------------------------------------------------------- Application 'gateway' is running! Access URLs: Local: http://localhost:7000 External: http://192.168.222.33:7000 Profile(s): [prod] ----------------------------------------------------------
但是当我尝试从浏览器点击7000时,没有响应/ UI
curl -v localhost:7000
* Rebuilt URL to: localhost:7000/
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 7000 (#0)
> GET / HTTP/1.1
> Host: localhost:7000
> User-Agent: curl/7.50.3
> Accept: */*
>
* Curl_http_done: called premature == 0
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
但是,我可以通过运行
让UI启动9000yarn start
但我不认为生产环境需要这样做。我错过了什么?谢谢你的帮助。