1

I have a huge java web-project. Recently I have migrated to gradle build from ant build.

Is it necessary to do 'clean' task each time I build ?
Or
What is the actual purpose of 'clean' task ?

(I know that 'clean' will clean the output directory. But I think always the files will get replaced each time I compile. Then why do we need to spend time to clean again)

There is one reason to clean (as I know) : If you remove a file and build without cleaning it, the old file will remain in the output folder until you clean it.

smilyface
  • 5,021
  • 8
  • 41
  • 57

1 Answers1

3

You do not need to 'clean' every time you build. If I recall gradle should only rebuild files that you've modified and all their dependents. See Why run 'gradle clean'? for the second part of your question.

Community
  • 1
  • 1
Brandon
  • 1,029
  • 3
  • 11
  • 21