JHipster 实体菜单在成功导入 jdl 后为空
JHipster Entities Menu is Empty after succeed import-jdl
我刚刚通过 docker 图像安装了 JHipster (VueJS),并且我直接从 https://start.jhipster.tech/jdl-studio/.
导入了 jdl 文件
jhipster@66b8176ee05f:~/app$ jhipster import-jdl ../jhipster.jdl
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing import-jdl ../jhipster.jdl
INFO! Found .yo-rc.json on path. This is an existing app
INFO! The JDL is being parsed.
warn: In the One-to-Many relationship from Employee to Job, only bidirectionality is supported for a One-to-Many association. The other side will be automatically added.
warn: In the One-to-Many relationship from Department to Employee, only bidirectionality is supported for a One-to-Many association. The other side will be automatically added.
INFO! No change in entity configurations, no entities were updated.
INFO! The JDL has been successfully parsed
INFO! Congratulations, JHipster execution is complete!
然后我 运行 ./mvnw -P-webpack 和 yarn 在不同的终端上启动。
两者都完美运行,应用程序通过 ./mvnw 在 localhost:8080 上运行,也从 npm start localhost:9000 运行。
这是我当前的架构(来自 http://localhost:9000/admin/docs):
这是我的问题,虽然模式已经完美导入,但 实体菜单 仍然是空的。
我尝试了以下解决方案,但没有任何效果:
- 隐身浏览器以空缓存启动。
- ./mvnw 和 ./mvnw -P-webpack
- npm 启动
任何人都可以帮助我如何解决这个问题?
通过使用 -P-webpack
,你停用了 webpack 配置文件,这意味着前端不是由 maven 构建的,也没有捆绑在后端,只有当你通过端口 9000 上的 webpack 开发服务器访问前端时,这才有效。
否则,如果您通过后端端口 (8080) 访问它,您将看到最新的成功构建的结果,在您的情况下是在项目生成时还没有实体。
你检查过你的 header/menues 模块了吗?
我在升级时丢失了所有实体列表。
它似乎已从 src/main/webapp/app/shared/layout/menus.entities.tsx
中删除(使用反应)。对于那些使用 Angular 的人,检查相同的模块。
恢复生成器所做的更改解决了我的问题。
直接从 JDL 生成 JHipster 项目重现了该问题。我打的是Angular,所以不是Vue相关的
我通过拆分这一步得到了解决方案:
jhipster import-jdl my-jdl-file.jdl
至:
jhipster
jhipster import-jdl my-jdl-file.jdl
或:
jhipster import-jdl my-jdl-file-application-part-only.jdl
jhipster import-jdl my-jdl-file-entities-part.jdl
它解决了“没有实体”的问题。
可以选择使用 jhipster jdl 命令将所有微服务和网关的全部代码重新生成到一个新文件夹中。它对我有用。
jhipster jdl sample.jdl
我刚刚通过 docker 图像安装了 JHipster (VueJS),并且我直接从 https://start.jhipster.tech/jdl-studio/.
导入了 jdl 文件jhipster@66b8176ee05f:~/app$ jhipster import-jdl ../jhipster.jdl
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing import-jdl ../jhipster.jdl
INFO! Found .yo-rc.json on path. This is an existing app
INFO! The JDL is being parsed.
warn: In the One-to-Many relationship from Employee to Job, only bidirectionality is supported for a One-to-Many association. The other side will be automatically added.
warn: In the One-to-Many relationship from Department to Employee, only bidirectionality is supported for a One-to-Many association. The other side will be automatically added.
INFO! No change in entity configurations, no entities were updated.
INFO! The JDL has been successfully parsed
INFO! Congratulations, JHipster execution is complete!
然后我 运行 ./mvnw -P-webpack 和 yarn 在不同的终端上启动。
两者都完美运行,应用程序通过 ./mvnw 在 localhost:8080 上运行,也从 npm start localhost:9000 运行。
这是我当前的架构(来自 http://localhost:9000/admin/docs):
这是我的问题,虽然模式已经完美导入,但 实体菜单 仍然是空的。
我尝试了以下解决方案,但没有任何效果:
- 隐身浏览器以空缓存启动。
- ./mvnw 和 ./mvnw -P-webpack
- npm 启动
任何人都可以帮助我如何解决这个问题?
通过使用 -P-webpack
,你停用了 webpack 配置文件,这意味着前端不是由 maven 构建的,也没有捆绑在后端,只有当你通过端口 9000 上的 webpack 开发服务器访问前端时,这才有效。
否则,如果您通过后端端口 (8080) 访问它,您将看到最新的成功构建的结果,在您的情况下是在项目生成时还没有实体。
你检查过你的 header/menues 模块了吗? 我在升级时丢失了所有实体列表。
它似乎已从 src/main/webapp/app/shared/layout/menus.entities.tsx
中删除(使用反应)。对于那些使用 Angular 的人,检查相同的模块。
恢复生成器所做的更改解决了我的问题。
直接从 JDL 生成 JHipster 项目重现了该问题。我打的是Angular,所以不是Vue相关的
我通过拆分这一步得到了解决方案:
jhipster import-jdl my-jdl-file.jdl
至:
jhipster
jhipster import-jdl my-jdl-file.jdl
或:
jhipster import-jdl my-jdl-file-application-part-only.jdl
jhipster import-jdl my-jdl-file-entities-part.jdl
它解决了“没有实体”的问题。
可以选择使用 jhipster jdl 命令将所有微服务和网关的全部代码重新生成到一个新文件夹中。它对我有用。
jhipster jdl sample.jdl