private void downloadRemotes(final File outputDirectory, List<String> remotes) { if (!outputDirectory.exists()) { try { Files.createDirectories(outputDirectory.toPath()); } catch (IOException e) { throw new IllegalArgumentException(e); } } remotes.stream() .map(remote -> { try { return new URL(remote); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } }) .forEach(url -> { try { IoUtil.download(this.log, url, new File(outputDirectory, getOutputName(url))); } catch (MojoExecutionException e) { throw new IllegalArgumentException(e); } }); }