docs: @SuppressWarnings("checkstyle:nestedifdepth")
  	protected synchronized String replaceAuthor(File sourceFile, int sourceLine, String text,
  			ExtendedArtifact artifact, ReplacementType replacementType) throws MojoExecutionException {
  		String result = text;
  		final Pattern p = buildMacroPatternWithGroup(Macros.MACRO_AUTHOR);
  		final Matcher m = p.matcher(text);
  		boolean hasResult = m.find();
  
  		if (hasResult) {
  			final StringBuffer sb = new StringBuffer();
  			final StringBuilder replacement = new StringBuilder();
  			String login;
  			URL url;
  			Contributor contributor;
  			do {
  				login = m.group(1);
  				if (login != null) {
  					login = login.trim();
  					if (login.length() > 0) {
  						replacement.setLength(0);
  						if (artifact != null) {
  							contributor = artifact.getPeople(login, getLog());
  							if (contributor != null) {
  								url = getContributorURL(contributor, getLog());
  								if (url == null) {
  									replacement.append(contributor.getName());
  								} else if (replacementType == ReplacementType.HTML) {
  									replacement.append("<a target=\"_blank\" href=\""); //$NON-NLS-1$
  									replacement.append(url.toExternalForm());
  									replacement.append("\">"); //$NON-NLS-1$
  									replacement.append(contributor.getName());
  									replacement.append("</a>"); //$NON-NLS-1$
  								} else {
  									replacement.append(contributor.getName());
  									replacement.append(" ["); //$NON-NLS-1$
  									replacement.append(url.toExternalForm());
  									replacement.append("]"); //$NON-NLS-1$
  								}
  							} else {
  								getBuildContext().addMessage(
  										sourceFile,
  										sourceLine, 1,
  										"unable to find a developer or a contributor " //$NON-NLS-1$
  										+ "with an id, a name or an email equal to: " //$NON-NLS-1$
  										+ login,
  										BuildContext.SEVERITY_WARNING, null);
  							}
  						}
  						if (replacement.length() != 0) {
  							m.appendReplacement(sb, Matcher.quoteReplacement(replacement.toString()));
  						}
  					} else {
  						getBuildContext().addMessage(
  								sourceFile,
  								sourceLine, 1,
  								"no login for Author tag: " + m.group(0), //$NON-NLS-1$
  								BuildContext.SEVERITY_WARNING, null);
  					}
  				} else {
  					getBuildContext().addMessage(
  							sourceFile,
  							sourceLine, 1,
  							"no login for Author tag: " + m.group(0), //$NON-NLS-1$
  							BuildContext.SEVERITY_WARNING, null);
  				}
  				hasResult = m.find();
  			} while (hasResult);
  
  			m.appendTail(sb);
  
  			result = sb.toString();
  		}
  		return result;
  	}