首页 > 解决方案 > 如何在 Vaadin 14 + Spring Boot 中构建工作 jar 文件?

问题描述

我试图将我的 Vaadin14 项目运行到生产环境中,但我的应用程序找不到任何 vaadin 流组件。我有一个默认的 application.properties 和 POM,并从这里下载了它https://vaadin.com/start/latest。我已经试过了,

删除节点模块 mvn clean mvn clean install -Pproduction mvn clean package -Pproduction

我得到这个错误

Failed to find the following imports in the `node_modules` tree:
  - @vaadin/flow-frontend/contextMenuConnector-es6.js
  - @vaadin/flow-frontend/comboBoxConnector.js
  - @vaadin/flow-frontend/gridConnector.js
  - @vaadin/flow-frontend/contextMenuConnector.js
  - @vaadin/flow-frontend/flow-component-renderer.js
  - @vaadin/flow-frontend/gridConnector-es6.js
  - @vaadin/flow-frontend/comboBoxConnector-es6.js
  - @vaadin/flow-frontend/vaadin-grid-flow-selection-column.js

如果构建失败,请检查是否安装了 npm 包。

修复构建删除node_modules目录以重置模块。此外,您可以运行npm install来修复node_modules树结构。

TIA

标签: javavaadin-flowvaadin14

解决方案


nvm 伙计们,已经找到了答案.. Vaadin 14.0.11v

将此添加到您的 application.properties

vaadin.productionMode = true <----- 在开发模式下注释此行

spring.servlet.multipart.enabled = false


推荐阅读