use of org.apache.maven.plugins.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;
}
use of org.apache.maven.plugins.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();
try (Writer writer = WriterFactory.newXmlWriter(optionsFile)) {
new JavadocOptionsXpp3Writer().write(writer, options);
}
return options;
}
Aggregations