Gradle war task is adding files twice beginning in 3.x


(Alice Young) #1

After upgrading gradle from 2.x to 3.1, my war files bloated to 100MB larger (about 30%) than normal. When unpacked, the total of the files on disk were just the usual size. I discovered while pulling a file out of the war manually, it was actually in there twice. I was able to duplicate this with 3.2-rc-1 with this super-simple build.gradle and two files, just a .jsp and web.xml:

apply plugin: 'war'
war {
    from "${projectDir}/src/main/webapp"
}

Then, list the files of the created war with jar tf blah.war:

META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/blah.jsp
WEB-INF/web.xml
WEB-INF/blah.jsp
WEB-INF/web.xml

Those two files are present twice. What’s going wrong here? In my main project, jar files are not duplicated (thankfully), but all images, jsp’s, css, js, etc. are.