use of org.apache.maven.plugins.javadoc.options.Taglet in project maven-plugins by apache.
the class AbstractJavadocMojo method getTagletPath.
/**
* Method to get the path of the taglet artifacts used in the <code>-tagletpath</code> option.
*
* @return a string that contains taglet path, separated by the System pathSeparator string
* (colon (<code>:</code>) on Solaris or semi-colon (<code>;</code>) on Windows).
* @throws MavenReportException if any
* @see File#pathSeparator
*/
private String getTagletPath() throws MavenReportException {
Set<TagletArtifact> tArtifacts = collectTagletArtifacts();
Collection<String> pathParts = new ArrayList<>();
for (TagletArtifact tagletArtifact : tArtifacts) {
if ((tagletArtifact != null) && (StringUtils.isNotEmpty(tagletArtifact.getGroupId())) && (StringUtils.isNotEmpty(tagletArtifact.getArtifactId())) && (StringUtils.isNotEmpty(tagletArtifact.getVersion()))) {
pathParts.addAll(getArtifactsAbsolutePath(tagletArtifact));
}
}
Set<Taglet> taglets = collectTaglets();
for (Taglet taglet : taglets) {
if (taglet == null) {
continue;
}
if ((taglet.getTagletArtifact() != null) && (StringUtils.isNotEmpty(taglet.getTagletArtifact().getGroupId())) && (StringUtils.isNotEmpty(taglet.getTagletArtifact().getArtifactId())) && (StringUtils.isNotEmpty(taglet.getTagletArtifact().getVersion()))) {
pathParts.addAll(getArtifactsAbsolutePath(taglet.getTagletArtifact()));
pathParts = JavadocUtil.pruneFiles(pathParts);
} else if (StringUtils.isNotEmpty(taglet.getTagletpath())) {
pathParts.add(taglet.getTagletpath());
pathParts = JavadocUtil.pruneDirs(project, pathParts);
}
}
StringBuilder path = new StringBuilder();
path.append(StringUtils.join(pathParts.iterator(), File.pathSeparator));
if (StringUtils.isNotEmpty(tagletpath)) {
path.append(JavadocUtil.unifyPathSeparator(tagletpath));
}
return path.toString();
}
Aggregations