Re: Why does Netbeans delete my CVS folder when I do a clean?
Fixed this by setting the defaultexcludes="yes". Not sure why it is set to no by default. Had to change it for every directory that ant is set to clean.
<target depends="init" if="no.dist.ear.dir" name="deps-clean" unless="no.deps"/>
<target depends="init" name="do-clean">
<condition property="build.dir.to.clean" value="${build.web.dir}">
<isset property="dist.ear.dir"/>
</condition>
<property name="build.dir.to.clean" value="${build.web.dir}"/>
<delete includeEmptyDirs="true" quiet="true" defaultexcludes="yes">
<fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
</delete>
<delete dir="${build.dir}" defaultexcludes="yes"/>
<available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
<delete dir="${dist.dir}" defaultexcludes="yes"/>
</target>
<target depends="do-clean" if="status.clean-failed" name="check-clean">
<echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
<echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
</target>
<target name="-post-clean">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>