Folks,
As part of my nightly build for a Java application, I do the following:
$ cd dirContainingPOM.XML $ svn update $ rm -rf target $ mvn package
Essentially, I get the latest version of the source code, delete all the files in the target directory, and build the jar package.
The question I have is if it is a good practice to delete everything in “target” directory or is it just an overkill. Is maven doing it automatically for me?
Thank you in advance for your help.
Regards,
Peter
It’s a good practice but you easily achieve the same thing by specifying the clean target in your maven command.
Instead of performing …
Try the following …
This will effectively negate the need to perform the rm -rf on your target directory.