Spring Boot 2.5 .war 与 Vaadin 静态资源打包
我有一个 Vaadin 8 应用程序(在可预见的将来无法升级 Vaadin),它正在从 Spring Boot 1.5.x 升级到 Spring Boot 2.5.x。我正在使用可自动执行的 .war 打包。
问题是生成的 .war 文件不包含已编译的主题 .css 文件 (styles.css
),因此应用程序无法正确呈现。 在 .war 内部,/VAADIN/themes/[themename]
文件夹仅包含以下文件:
Spring Boot 1.5.x 版本的同一文件夹包含以下内容:
,对于 Spring Boot 2.5.x,在构建过程中生成的带有 -plain.war
后缀(不包含依赖项)的 .war 文件,确实有 .css
和 .css.gz
文件。因此,似乎是在 Spring Boot 重新打包期间,这些文件从最终的 .war 中删除了。
I have a Vaadin 8 application (can't upgrade Vaadin for the foreseeable future) that is being upgraded from Spring Boot 1.5.x to Spring Boot 2.5.x. I'm using self-executable .war packaging.
The problem is that the resulting .war file does not contain the compiled theme .css files (styles.css
) so the app doesn't render properly.
Inside the .war, the /VAADIN/themes/[themename]
folder only contains these files:
While the same folder for the Spring Boot 1.5.x version contains these:
Interestengly, for Spring Boot 2.5.x, the .war file that is generated with the -plain.war
suffix (not containing the dependencies) during the build process, does have the .css
and .css.gz
files. So it seems to be during Spring Boot's repackaging that the files are removed from the final .war.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
升级到 Spring Boot 2.5.x 后,任务显然没有按正确的顺序执行。
我通过在 gradle 构建脚本的
bootWar { }
块中使用dependsOn
修复了这个问题:After the upgrade to Spring Boot 2.5.x, tasks were apparently not executed in the correct order.
I've fixed it by using
dependsOn
in thebootWar { }
block of the gradle build script: