Source:
<code>private void doGet(File outputFile) throws Exception { String urlStr = this.uri.toString(); String[] segments = urlStr.split("/"); String file = segments[segments.length - 1]; String repoUrl = urlStr.substring(0, urlStr.length() - file.length() - 1); Repository repository = new Repository(repoUrl, repoUrl); Wagon wagon = this.wagonManager.getWagon(repository.getProtocol()); if (readTimeOut > 0) { wagon.setReadTimeout(readTimeOut); getLog().info( "Read Timeout is set to " + readTimeOut + " milliseconds (apprx " + Math.round(readTimeOut * 1.66667e-5) + " minutes)"); } ConsoleDownloadMonitor downloadMonitor = null; if (this.session.getSettings().isInteractiveMode()) { downloadMonitor = new ConsoleDownloadMonitor(this.getLog()); wagon.addTransferListener(downloadMonitor); } AuthenticationInfo authenticationInfo = new AuthenticationInfo(); if (StringUtils.isNotBlank(username)) { getLog().debug("providing custom authentication"); getLog().debug("username: " + username + " and password: ***"); authenticationInfo.setUserName(username); authenticationInfo.setPassword(password); } else if (StringUtils.isNotBlank(serverId)) { getLog().debug("providing custom authentication for " + serverId); <START> Server s = settings.getServer(serverId); <END> if (s == null) throw new MojoExecutionException("Server " + serverId + " not found"); getLog().debug("serverId " + serverId + " supplies username: " + s.getUsername() + " and password: ***"); authenticationInfo.setUserName(s.getUsername()); authenticationInfo.setPassword(s.getPassword()); } ProxyInfo proxyInfo = this.wagonManager.getProxy(repository.getProtocol()); wagon.connect(repository, authenticationInfo, proxyInfo); wagon.get(file, outputFile); wagon.disconnect(); if (downloadMonitor != null) { wagon.removeTransferListener(downloadMonitor); } }</code><technical_language>@mykelalvis please, rename server. s is meaningless :)</technical_language>

Target:
private void doGet(File outputFile) throws Exception { String urlStr = this.uri.toString(); String[] segments = urlStr.split("/"); String file = segments[segments.length - 1]; String repoUrl = urlStr.substring(0, urlStr.length() - file.length() - 1); Repository repository = new Repository(repoUrl, repoUrl); Wagon wagon = this.wagonManager.getWagon(repository.getProtocol()); if (readTimeOut > 0) { wagon.setReadTimeout(readTimeOut); getLog().info( "Read Timeout is set to " + readTimeOut + " milliseconds (apprx " + Math.round(readTimeOut * 1.66667e-5) + " minutes)"); } ConsoleDownloadMonitor downloadMonitor = null; if (this.session.getSettings().isInteractiveMode()) { downloadMonitor = new ConsoleDownloadMonitor(this.getLog()); wagon.addTransferListener(downloadMonitor); } AuthenticationInfo authenticationInfo = new AuthenticationInfo(); if (StringUtils.isNotBlank(username)) { getLog().debug("providing custom authentication"); getLog().debug("username: " + username + " and password: ***"); authenticationInfo.setUserName(username); authenticationInfo.setPassword(password); } else if (StringUtils.isNotBlank(serverId)) { getLog().debug("providing custom authentication for " + serverId); Server server = settings.getServer(serverId); if (server == null) throw new MojoExecutionException(String.format("Server %s not found", serverId)); getLog().debug(String.format("serverId %s supplies username: %s and password: ***", serverId, server.getUsername() )); authenticationInfo.setUserName(server.getUsername()); authenticationInfo.setPassword(server.getPassword()); } ProxyInfo proxyInfo = this.wagonManager.getProxy(repository.getProtocol()); wagon.connect(repository, authenticationInfo, proxyInfo); wagon.get(file, outputFile); wagon.disconnect(); if (downloadMonitor != null) { wagon.removeTransferListener(downloadMonitor); } }