Skip to content

Commit 4099231

Browse files
authored
Update ReallyExecutableJarMojo.java
Should overwrite existing files so that doing mvn package twice in a row works
1 parent 5979a87 commit 4099231

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/skife/waffles/ReallyExecutableJarMojo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.nio.file.Files;
3535
import java.nio.file.Path;
3636
import java.nio.file.Paths;
37+
import java.nio.file.StandardCopyOption;
3738
import java.util.ArrayList;
3839
import java.util.Arrays;
3940
import java.util.List;
@@ -143,7 +144,7 @@ public void execute() throws MojoExecutionException {
143144
File file = files.get(0);
144145
File dir = file.getParentFile();
145146
File exec = new File(dir, programFile);
146-
Files.copy(file.toPath(), exec.toPath());
147+
Files.copy(file.toPath(), exec.toPath(), StandardCopyOption.REPLACE_EXISTING);
147148
makeExecutable(exec);
148149
if (attachProgramFile) {
149150
projectHelper.attachArtifact(project, programFileType, exec);

0 commit comments

Comments
 (0)