在 intellij 中生成部署描述符(web.xml)
generating Deployment Descriptor (web.xml) in intellij
我正在为我的 spring 项目使用 gradle,需要复制并粘贴 web.xml
的内容(以及其他基于 xml 的 spring 配置)每一次!有没有自动生成这些文件的方法,就像在 eclipse 中可以完成的那样?
好的,到目前为止我知道的最好方法是为不同的 xml 文件创建一个新模板文件:
Right Click on project > New > Edit File Template > ...
根据 IntelliJ IDEA 文档,您可以使用 Web 方面设置生成部署描述符:Managing deployment descriptors
- 至少自版本 2016.1
第一个答案是创建自己的文件模板的好方法。但是 Intellij 已经为 web.xml
和 Spring 文件生成了默认模板。
至于现在,通过使用 alt + ins
,Intellij 提供了 JSP Tag Library Descriptor
、New Faces Config File
和 Spring Config
这对 xml based spring configurations
.[=19 很有帮助=]
而对于 web.xml
文件,Project Structure (ctrl + alt + shift + s) > Facets > Deployment Descriptors > + > web.xml
将为您生成一个 web.xml
文件。
我正在为我的 spring 项目使用 gradle,需要复制并粘贴 web.xml
的内容(以及其他基于 xml 的 spring 配置)每一次!有没有自动生成这些文件的方法,就像在 eclipse 中可以完成的那样?
好的,到目前为止我知道的最好方法是为不同的 xml 文件创建一个新模板文件:
Right Click on project > New > Edit File Template > ...
根据 IntelliJ IDEA 文档,您可以使用 Web 方面设置生成部署描述符:Managing deployment descriptors - 至少自版本 2016.1
第一个答案是创建自己的文件模板的好方法。但是 Intellij 已经为 web.xml
和 Spring 文件生成了默认模板。
至于现在,通过使用 alt + ins
,Intellij 提供了 JSP Tag Library Descriptor
、New Faces Config File
和 Spring Config
这对 xml based spring configurations
.[=19 很有帮助=]
而对于 web.xml
文件,Project Structure (ctrl + alt + shift + s) > Facets > Deployment Descriptors > + > web.xml
将为您生成一个 web.xml
文件。