将src / main / webapp添加到jar以启动弹出 [英] Add src/main/webapp to jar for spring boot
问题描述
但是这会导致2个问题:
- 我正在使用外部工具来编辑这些文件,而Eclipse
2秒后刷新(所以当我编辑html文件时,我不能
只是刷新页面:我必须等待...) - 每当我更改一个
java文件,一个复制3268资源任务开始:需要时间,
,如果我在调试中启动应用程序如果任务是
未完成,则崩溃。
那么,我如何设置我的maven包阶段来复制文件,同时保持一切的方式是调试(编译阶段?)
使用此插件 https://maven.apache.org/plugins/maven-resources- plugin / examples / copy-resources.html ,您可以在maven的指定阶段复制文件。
但是我从来没有遇到你提到的问题,我使用的是Intellij Idea,你应该尝试一下
The spring boot docs says you should put the "static" html resources under /static (or /public or /resources or /META-INF/resources). But this leads to 2 problems:
- I'm using an external tool to edit those files, and Eclipse refreshes after 2 seconds (so when I'm editing an html file, I can't just refresh the page: I have to wait...)
- whenever I change a java file, a "Copying 3268 resources" task starts: it takes time, and if I start the app in debug it actually crashes if the task is not finished.
So: how can I set my maven "package" phase to copy those files, while keeping everything the way it is for debugging ("compile" phase?)
Using this plugin https://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html you can copy files during the specified phase on maven.
But I've never had the problem you mentioned, I'm using Intellij Idea, you should give it a try
这篇关于将src / main / webapp添加到jar以启动弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!