Java Gradle war自定义-文件夹名称
我需要在war文件中包含其他文件夹。 我发现以下文档页面: 并遵循了其中的示例(仅相关部分): 它正确地移动了src/additionalWebInf文件夹的内容,但是我需要将内容放在webInf中的一个文件夹中,而不是直接放在webInf中。 当前情况:Java Gradle war自定义-文件夹名称,java,gradle,war,Java,Gradle,War,我需要在war文件中包含其他文件夹。 我发现以下文档页面: 并遵循了其中的示例(仅相关部分): 它正确地移动了src/additionalWebInf文件夹的内容,但是我需要将内容放在webInf中的一个文件夹中,而不是直接放在webInf中。 当前情况: app.war/WEB-INF/file1 app.war/WEB-INF/file2 app.war/WEB-INF/fileN app.war/WEB-INF/myCustomFolder/file1 app.war/WEB-INF/m
app.war/WEB-INF/file1
app.war/WEB-INF/file2
app.war/WEB-INF/fileN
app.war/WEB-INF/myCustomFolder/file1
app.war/WEB-INF/myCustomFolder/file2
app.war/WEB-INF/myCustomFolder/fileN
理想情况:
app.war/WEB-INF/file1
app.war/WEB-INF/file2
app.war/WEB-INF/fileN
app.war/WEB-INF/myCustomFolder/file1
app.war/WEB-INF/myCustomFolder/file2
app.war/WEB-INF/myCustomFolder/fileN
如何使用gradle将文件移动到webInf内的自定义(新)文件夹中?最简单的方法是将另一个级别添加到
additionalWebInf
,使文件位于src/additionalWebInf/myCustomFolder/fileN
回答您的问题:阅读webInf
闭包配置
所以你可以
war {
webInf {
from 'src/additionalWebInf'
into 'myCustomFolder'
}
}
或
最简单的方法是向
additionalWebInf
添加另一个级别,使文件位于src/additionalWebInf/myCustomFolder/fileN
回答您的问题:阅读webInf
闭包配置
所以你可以
war {
webInf {
from 'src/additionalWebInf'
into 'myCustomFolder'
}
}
或