Skip to content

Commit 1baf2b0

Browse files
committed
build fail if error occurs while copying additional resource
1 parent 29e3f2a commit 1baf2b0

File tree

1 file changed

+8
-11
lines changed
  • src/main/java/io/github/fvarrui/javapackager/packagers

1 file changed

+8
-11
lines changed

src/main/java/io/github/fvarrui/javapackager/packagers/Packager.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,26 +205,23 @@ public void resolveResources() throws Exception {
205205
* @param resources List of files and folders to be copied
206206
* @param destination Destination folder. All specified resources will be copied
207207
* here
208+
* @throws Exception
208209
*/
209-
protected void copyAdditionalResources(List<File> resources, File destination) {
210+
protected void copyAdditionalResources(List<File> resources, File destination) throws Exception {
210211

211212
Logger.infoIndent("Copying additional resources");
212213

213-
resources.stream().forEach(r -> {
214+
for (File r : resources) {
214215
if (!r.exists()) {
215216
Logger.warn("Additional resource " + r + " doesn't exist");
216217
return;
217218
}
218-
try {
219-
if (r.isDirectory()) {
220-
FileUtils.copyFolderToFolder(r, destination);
221-
} else if (r.isFile()) {
222-
FileUtils.copyFileToFolder(r, destination);
223-
}
224-
} catch (Exception e) {
225-
Logger.error(e.getMessage(), e);
219+
if (r.isDirectory()) {
220+
FileUtils.copyFolderToFolder(r, destination);
221+
} else if (r.isFile()) {
222+
FileUtils.copyFileToFolder(r, destination);
226223
}
227-
});
224+
}
228225

229226
// copy bootstrap script
230227
if (FileUtils.exists(getScripts().getBootstrap())) {

0 commit comments

Comments
 (0)