Skip to content

Commit

Permalink
Fix eclipse-tycho#664 delete file on exit by default
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
  • Loading branch information
laeubi committed Feb 26, 2022
1 parent b66db2c commit 41e943e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public class UpdateConsumerPomMojo extends AbstractMojo {
@Parameter(defaultValue = ".tycho-consumer-pom.xml", required = true)
protected String tychoPomFilename;

/**
* If deleteOnExit is true the file will be marked for deletion on JVM exit
*/
@Parameter(defaultValue = "true")
protected boolean deleteOnExit = true;

@Parameter
protected Boolean skipPomGeneration;

Expand Down Expand Up @@ -119,6 +125,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}
}
File output = new File(outputDirectory, tychoPomFilename);
if (deleteOnExit) {
output.deleteOnExit();
}
try {
modelWriter.write(output, null, projectModel);
} catch (IOException e) {
Expand Down

0 comments on commit 41e943e

Please sign in to comment.