How do delete(gradle assemble) 'log4j2-test.xml'?

The log4j-test.xml file in /src/main/resources/log4j2-test.xml

Project module:


------ core

------ webapp(/src/main/resources/log4j2-test.xml, delete it.)

Do you really want to delete a file from your source tree? Is this file generated by another task? If you simply want to exclude it from the final jar there are ways to accomplish that as well. Can you provide some additional context?

I want to remove it when compiling the package! TK u.

Execution gradle assemble, delete log4j2-test.xml file from war

Got it. Just exclude that file then.

processResources {

exclude ‘log4j2-test.xml’


Thank you very much to solve my big problem!