Search in sources :

Example 1 with BootclasspathArtifact

use of org.apache.maven.plugins.javadoc.options.BootclasspathArtifact in project maven-plugins by apache.

the class AbstractJavadocMojo method getBootclassPath.

/**
 * Method to get the path of the bootclass artifacts used in the <code>-bootclasspath</code> option.
 *
 * @return a string that contains bootclass 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 getBootclassPath() throws MavenReportException {
    Set<BootclasspathArtifact> bootclasspathArtifacts = collectBootClasspathArtifacts();
    List<String> bootclassPath = new ArrayList<>();
    for (BootclasspathArtifact aBootclasspathArtifact : bootclasspathArtifacts) {
        if ((StringUtils.isNotEmpty(aBootclasspathArtifact.getGroupId())) && (StringUtils.isNotEmpty(aBootclasspathArtifact.getArtifactId())) && (StringUtils.isNotEmpty(aBootclasspathArtifact.getVersion()))) {
            bootclassPath.addAll(getArtifactsAbsolutePath(aBootclasspathArtifact));
        }
    }
    bootclassPath = JavadocUtil.pruneFiles(bootclassPath);
    StringBuilder path = new StringBuilder();
    path.append(StringUtils.join(bootclassPath.iterator(), File.pathSeparator));
    if (StringUtils.isNotEmpty(bootclasspath)) {
        path.append(JavadocUtil.unifyPathSeparator(bootclasspath));
    }
    return path.toString();
}
Also used : ArrayList(java.util.ArrayList) BootclasspathArtifact(org.apache.maven.plugins.javadoc.options.BootclasspathArtifact)

Aggregations

ArrayList (java.util.ArrayList)1 BootclasspathArtifact (org.apache.maven.plugins.javadoc.options.BootclasspathArtifact)1