in maven-wrapper/src/main/java/org/apache/maven/wrapper/DefaultDownloader.java [88:98]
private void downloadInternal(URI address, Path destination) throws IOException {
URL url = address.toURL();
URLConnection conn = url.openConnection();
addBasicAuthentication(address, conn);
final String userAgentValue = calculateUserAgent();
conn.setRequestProperty("User-Agent", userAgentValue);
try (InputStream inStream = conn.getInputStream()) {
Files.copy(inStream, destination, StandardCopyOption.REPLACE_EXISTING);
}
}