我是 gradle 新手。我想用 gradle 启动一个网络应用程序。我使用的版本是v3.1
目前,我只在 build.gradle 文件中添加 apply plugin: 'war' 。
我使用war插件,但运行./gradlew build后它不会创建META-INF、WEB-INF文件夹和web.xml。
我是否需要手动创建这些文件夹和文件,或者 gradle 有一种我不知道的自动创建它们的方法?
最佳答案
Gradle specification of War plugin回答你的问题:
The default behavior of the War task is to copy the content of src/main/webapp to the root of the archive. Your webapp directory may of course contain a WEB-INF sub-directory, which may contain a web.xml file. Your compiled classes are compiled to WEB-INF/classes. All the dependencies of the runtime configuration are copied to WEB-INF/lib.
关于java - gradle可以自动创建META-INF、WEB-INF文件夹和web.xml吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40232285/