vaadin应用程序与gradle安装节点在生产中

发布于 2025-01-19 07:25:35 字数 1240 浏览 3 评论 0原文

我一直在和Vaadin ICW Gradle一起玩。当我使用-pvaadin.productionmode构建应用程序时,然后在日志记录中执行JAR时,我会看到FrontendTools安装节点。

根据文档,我希望Java应用程序能够为所有JS提供服务,并且在运行时不需要节点的依赖关系/安装。

2022-04-05 20:25:19.344  INFO 8 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2022-04-05 20:25:19.351  INFO 8 --- [           main] c.xxx.xxxx.configuration.Application   : Started Application in 4.142 seconds (JVM running for 4.475)
2022-04-05 20:25:19.431  INFO 8 --- [           main] c.a.b.c.data.generator.DataGenerator     : Generating demo data
2022-04-05 20:25:19.431  INFO 8 --- [           main] c.a.b.c.data.generator.DataGenerator     : ... generating 100 Configuration entities...
2022-04-05 20:25:19.459  INFO 8 --- [           main] c.v.flow.server.frontend.FrontendTools   : Couldn't find node. Installing Node and npm to /home/myuser/.vaadin.
2022-04-05 20:25:19.469  INFO 8 --- [           main] NodeInstaller                            : Installing node version v16.14.2

我需要设置属性或标志吗?这些示例主要是基于Maven的,也许我需要在Gradle中做更多的事情?

我这样的建造: gradle -pvaadin.productionmode 运行:defaultTasks(“清洁”,“ vaadinbuildfrontend”,“ build”)

I've been playing with vaadin icw gradle. When I build the application with the -Pvaadin.productionMode and then execute the jar, in the logging I see the FrontendTools installing node.

Based on the documentation I would expect the Java app to serve all js, and there needn't be a dependency/installation needed of node at runtime.

2022-04-05 20:25:19.344  INFO 8 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2022-04-05 20:25:19.351  INFO 8 --- [           main] c.xxx.xxxx.configuration.Application   : Started Application in 4.142 seconds (JVM running for 4.475)
2022-04-05 20:25:19.431  INFO 8 --- [           main] c.a.b.c.data.generator.DataGenerator     : Generating demo data
2022-04-05 20:25:19.431  INFO 8 --- [           main] c.a.b.c.data.generator.DataGenerator     : ... generating 100 Configuration entities...
2022-04-05 20:25:19.459  INFO 8 --- [           main] c.v.flow.server.frontend.FrontendTools   : Couldn't find node. Installing Node and npm to /home/myuser/.vaadin.
2022-04-05 20:25:19.469  INFO 8 --- [           main] NodeInstaller                            : Installing node version v16.14.2

Is there a property or flag I need setting? The examples are mostly maven based perhaps I need to do a little bit more in gradle?

I build like so:
gradle -Pvaadin.productionMode
Which runs: defaultTasks("clean", "vaadinBuildFrontend", "build")

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吹泡泡o 2025-01-26 07:25:35

在消除和检查基本gradle示例和我自己的项目之间的所有差异之后:

罪魁祸首正在使用com.vaadin.exampledata.exampledatagenerator来设置一些虚假的数据。
如果我不这样做,节点将不确定

是错误还是功能。

After eliminating and checking all differences between the base gradle example and my own project:

The culprit was using the com.vaadin.exampledata.ExampleDataGenerator to setup some bogus data.
If I don't, node won't install ¯_(ツ)_/¯

Not sure if that is a bug or a feature.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文