Search in sources :

Example 1 with JavadocOptionsXpp3Writer

use of org.apache.maven.plugin.javadoc.options.io.xpp3.JavadocOptionsXpp3Writer in project maven-plugins by apache.

the class AbstractJavadocMojo method buildJavadocOptions.

/**
     * Generate a javadoc-options XML file, for either bundling with a javadoc-resources artifact OR
     * supplying to a distro module in a includeDependencySources configuration, so the javadoc options
     * from this execution can be reconstructed and merged in the distro build.
     *
     * @return {@link JavadocOptions}
     * @throws IOException {@link IOException}
     * @since 2.7
     */
protected final JavadocOptions buildJavadocOptions() throws IOException {
    JavadocOptions options = new JavadocOptions();
    options.setBootclasspathArtifacts(toList(bootclasspathArtifacts));
    options.setDocfilesSubdirsUsed(docfilessubdirs);
    options.setDocletArtifacts(toList(docletArtifact, docletArtifacts));
    options.setExcludedDocfilesSubdirs(excludedocfilessubdir);
    options.setExcludePackageNames(toList(excludePackageNames));
    options.setGroups(toList(groups));
    options.setLinks(links);
    options.setOfflineLinks(toList(offlineLinks));
    options.setResourcesArtifacts(toList(resourcesArtifacts));
    options.setTagletArtifacts(toList(tagletArtifact, tagletArtifacts));
    options.setTaglets(toList(taglets));
    options.setTags(toList(tags));
    if (getProject() != null && getJavadocDirectory() != null) {
        options.setJavadocResourcesDirectory(toRelative(getProject().getBasedir(), getJavadocDirectory().getAbsolutePath()));
    }
    File optionsFile = getJavadocOptionsFile();
    Writer writer = null;
    try {
        writer = WriterFactory.newXmlWriter(optionsFile);
        new JavadocOptionsXpp3Writer().write(writer, options);
    } finally {
        close(writer);
    }
    return options;
}
Also used : JavadocOptions(org.apache.maven.plugin.javadoc.options.JavadocOptions) JavadocOptionsXpp3Writer(org.apache.maven.plugin.javadoc.options.io.xpp3.JavadocOptionsXpp3Writer) File(java.io.File) JavadocOptionsXpp3Writer(org.apache.maven.plugin.javadoc.options.io.xpp3.JavadocOptionsXpp3Writer) Writer(java.io.Writer)

Aggregations

File (java.io.File)1 Writer (java.io.Writer)1 JavadocOptions (org.apache.maven.plugin.javadoc.options.JavadocOptions)1 JavadocOptionsXpp3Writer (org.apache.maven.plugin.javadoc.options.io.xpp3.JavadocOptionsXpp3Writer)1