in src/main/java/org/apache/maven/plugin/doap/DoapMojo.java [1067:1105]
private void writeDownloadPage(XMLWriter writer, MavenProject project) {
String downloadPage = DoapUtil.interpolate(doapOptions.getDownloadPage(), project, settings);
if (downloadPage == null || downloadPage.isEmpty()) {
messages.addMessage(
new String[] {"doapOptions", "downloadPage"}, null, UserMessages.REQUIRED_BY_ASF_OR_RECOMMENDED);
return;
}
try {
new URL(downloadPage);
DoapUtil.writeComment(writer, "Download page.");
DoapUtil.writeRdfResourceElement(writer, doapOptions.getXmlnsPrefix(), "download-page", downloadPage);
} catch (MalformedURLException e) {
messages.addMessage(new String[] {"doapOptions", "downloadPage"}, downloadPage, UserMessages.INVALID_URL);
}
if (StringUtils.isNotEmpty(doapOptions.getDownloadMirror())) {
boolean addComment = false;
String[] downloadMirrors = StringUtils.split(doapOptions.getDownloadMirror(), ",");
for (String downloadMirror : downloadMirrors) {
downloadMirror = downloadMirror.trim();
try {
new URL(downloadMirror);
if (!addComment) {
DoapUtil.writeComment(writer, "Mirror of software download web page.");
addComment = true;
}
DoapUtil.writeRdfResourceElement(
writer, doapOptions.getXmlnsPrefix(), "download-mirror", downloadMirror);
} catch (MalformedURLException e) {
messages.addMessage(
new String[] {"doapOptions", "downloadMirror"}, downloadMirror, UserMessages.INVALID_URL);
}
}
}
}