JHipster应用程序无法在prod模式下运行

时间:2018-04-06 13:54:38

标签: angular5 jhipster yarnpkg

我有一个monolith应用程序,在开发模式下一切正常。当我打包生产应用程序时,前端不起作用。 后端运行正常。 您有任何建议/建议如何调试吗? 我已经清理并重新安装了node_modules和yarn.lock文件。 没有不同。 任何建议都会非常感激。

Using JHipster version installed locally in current project's node_modules Executing jhipster:info Options:  Welcome to the JHipster Information Sub-Generator

##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**


<details> <summary>.yo-rc.json file</summary> <pre> {   "generator-jhipster": {
    "promptValues": {
      "packageName": "---"
    },
    "jhipsterVersion": "4.14.0",
    "baseName": "devkit",
    "packageName": "---",
    "packageFolder": "---",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "no",
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "mssql",
    "prodDatabaseType": "mssql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "replaced-by-jhipster-info",
    "clientFramework": "angularX",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": false   } } </pre> </details>




##### **Environment and Tools**

java version "1.8.0_161" Java(TM) SE Runtime Environment (build
1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

git version 2.15.0.windows.1

node: v8.9.4

npm: 5.6.0

yeoman: 2.0.1

yarn: 1.3.2

Docker version 18.03.0-ce, build 0520e24

docker-compose version 1.20.1, build 5d8c71b2

Congratulations, JHipster execution is complete!

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

尝试生成jar而不是war存档会破坏prod模式下的应用程序。只需在构建代码下添加<fileName>代码即可轻松更改将生成的归档的文件名,但如果您想更改扩展名,则不要更改<packaging>代码,因为这会打破正在制作的应用程序。

更新: 我发现只需将文件从war重命名为jar(手动)就可以使前面描述的错误打破前端。