在 Intellij 中生成部署描述符 (web.xml)

Yar*_*Yar 6 web.xml intellij-idea

我正在为我的 spring 项目使用 gradle,并且每次都需要复制和粘贴web.xml(以及其他基于 xml 的 spring 配置)的内容!反正有没有自动生成这些文件,就像它可以在 eclipse 中完成的方式一样?

小智 6

第一个答案是创建自己的文件模板的好方法。但是 Intellij 已经为web.xmlSpring 文件生成了默认模板。

至于现在,使用alt + ins,提供的IntelliJ JSP Tag Library DescriptorNew Faces Config FileSpring Config这是有帮助的xml based spring configurations

而对于web.xml文件,Project Structure (ctrl + alt + shift + s) > Facets > Deployment Descriptors > + > web.xml将为您生成一个web.xml文件。


Yar*_*Yar 3

好的,到目前为止我知道的最好方法是为不同的 xml 文件创建一个新模板文件:

Right Click on project > New > Edit File Template > ...