Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1
-
Fix Version/s: 2.5
-
Labels:None
-
Environment:Unix SunOS 5.9, multiuser environment
-
Number of attachments :
Description
cobertura-maven-plugin/2.1 creates cobertura*cmdline.bak files which are not deleted after termination of the cobertura run leaving those files on the disk. This problem starts to be serious in multi-user environments where it is not possible to overwrite leftover bak file created by another user.
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Unable to obtain CommandsFile location.
Embedded error: Unable to open file /var/tmp/cobertura.59407.cmdline.bak
for writing.
The problem seems to be located in "src/main/java/org/codehaus/mojo/cobertura/tasks/AbstractTask.java"
and a simple fileDelete should solve the problem since my understanding is that the only thing the code does is to test if the "commandsFile" exists.
FileUtils.copyFile( new File( commandsFile ), new File( commandsFile + ".bak" ) );
+ FileUtils.fileDelete( commandsFile + ".bak" );
or to use FileUtils.fileExists instead.
Regards,
Pawel Josefsson
Activity
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Closed [ 6 ] |
| Assignee | Robert Scholte [ rfscholte ] | |
| Fix Version/s | 2.5 [ 16413 ] | |
| Resolution | Fixed [ 1 ] |