我必须将ant项目转换为gradle项目。这里,当我运行 gradle build 时,它会创建 war 文件,当它部署在服务器上时,展开的 war 文件夹有两个文件夹 META-INF 和 WEB-INF ,我的要求是 1.将 web.xml 从如图所示的 config 文件夹复制到 WEB-INF 文件夹 和 jsp 文件夹(如图所示)到爆炸文件夹
最佳答案
apply plugin: 'war'
....
war {
from 'jsp' // adds a file-set to the root of the archive
webXml = file('config/web.xml') // copies a file to WEB-INF/web.xml
}
关于java - 在gradle中将文件从一个文件夹复制到另一个文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39829974/