I have a set of project's on which I need to execute Sonar. Once I execute sonar task and it publishes the result it deletes all the files in the directory .sonartemp except the file persistit_tempvol. This file is locked by Java SE runtime and I am unable to delete this.
The reason I want to delete this file is once it starts executing another project it creates the same file for that project and the data from previous persistit_tempvol is still in Java Heap. So after I run few projects I actually go OutOfMemory.
I tried increaing the Heap memory, but the number of projects are very high ~100. I don't want to go one by one and execute them. I want to keep doing it in the loop.
I am running sonarrunner 2.4, windows 7, Java 8, sonar ant task 2.3, Sonar Qube 5.1
Here's how I am executing the sonar runner:
EmbeddedRunner.create().addProperties(properties)
.unmask("org.apache.tools.ant").unmask("org.sonar.ant")
.execute();
The properties is the property file of sonar.
I guess I cannot delete this file from sonar as it's locked by by my JVM. Is there a way I can delete this file?
ForkedRunner.create().addProperties(properties).execute();
That's all I had to do and it is working fine now. Thanks :)