Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ public abstract class AbstractFixJavadocMojo extends AbstractMojo {
*/
private InputHandler inputHandler;

/**
* <p>Constructor for AbstractFixJavadocMojo.</p>
*
* @param inputHandler a {@link org.codehaus.plexus.components.interactivity.InputHandler} object
*/
public AbstractFixJavadocMojo(InputHandler inputHandler) {
this.inputHandler = inputHandler;
}
Expand Down Expand Up @@ -397,9 +402,7 @@ public AbstractFixJavadocMojo(InputHandler inputHandler) {
*/
private List<String> sinceClasses;

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (!fixClassComment && !fixFieldComment && !fixMethodComment) {
Expand Down Expand Up @@ -450,11 +453,18 @@ public void execute() throws MojoExecutionException, MojoFailureException {
// protected methods
// ----------------------------------------------------------------------

/**
* <p>Getter for the field <code>project</code>.</p>
*
* @return a {@link org.apache.maven.project.MavenProject} object
*/
protected final MavenProject getProject() {
return project;
}

/**
* <p>getArtifactType.</p>
*
* @param p not null maven project.
* @return the artifact type.
*/
Expand All @@ -463,6 +473,8 @@ protected String getArtifactType(MavenProject p) {
}

/**
* <p>getProjectSourceRoots.</p>
*
* @param p not null maven project.
* @return the list of source paths for the given project.
*/
Expand All @@ -473,9 +485,11 @@ protected List<String> getProjectSourceRoots(MavenProject p) {
}

/**
* <p>getCompileClasspathElements.</p>
*
* @param p not null
* @return the compile classpath elements
* @throws DependencyResolutionRequiredException
* @throws org.apache.maven.artifact.DependencyResolutionRequiredException
* if any
*/
protected List<String> getCompileClasspathElements(MavenProject p) throws DependencyResolutionRequiredException {
Expand All @@ -485,6 +499,8 @@ protected List<String> getCompileClasspathElements(MavenProject p) throws Depend
}

/**
* <p>getJavaMethodAsString.</p>
*
* @param javaExecutable not null
* @return the fully qualify name of javaMethod with signature
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,17 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {

private ToolchainManager toolchainManager;

/**
* <p>Constructor for AbstractJavadocMojo.</p>
*
* @param siteTool a {@link org.apache.maven.doxia.tools.SiteTool} object
* @param archiverManager a {@link org.codehaus.plexus.archiver.manager.ArchiverManager} object
* @param resourceResolver a {@link org.apache.maven.plugins.javadoc.resolver.ResourceResolver} object
* @param repoSystem a {@link org.eclipse.aether.RepositorySystem} object
* @param artifactHandlerManager a {@link org.apache.maven.artifact.handler.manager.ArtifactHandlerManager} object
* @param mavenProjectBuilder a {@link org.apache.maven.project.ProjectBuilder} object
* @param toolchainManager a {@link org.apache.maven.toolchain.ToolchainManager} object
*/
public AbstractJavadocMojo(
SiteTool siteTool,
ArchiverManager archiverManager,
Expand Down Expand Up @@ -1694,6 +1705,11 @@ protected boolean isTest() {
return false;
}

/**
* <p>Getter for the field <code>outputDirectory</code>.</p>
*
* @return a {@link java.lang.String} object
*/
protected String getOutputDirectory() {
return outputDirectory.getAbsolutePath();
}
Expand All @@ -1708,11 +1724,18 @@ protected String getPluginReportOutputDirectory() {
return getOutputDirectory() + "/" + (isTest() ? "test" : "") + "apidocs";
}

/**
* <p>Getter for the field <code>project</code>.</p>
*
* @return a {@link org.apache.maven.project.MavenProject} object
*/
protected MavenProject getProject() {
return project;
}

/**
* <p>getProjectBuildOutputDirs.</p>
*
* @param p not null maven project
* @return the list of directories where compiled classes are placed for the given project. These dirs are
* added to the javadoc classpath.
Expand All @@ -1726,6 +1749,8 @@ protected List<File> getProjectBuildOutputDirs(MavenProject p) {
}

/**
* <p>getClassesFile.</p>
*
* @param project the project in which to find a classes file
* @return null, the attached artifact file, or outputDirectory.
*/
Expand Down Expand Up @@ -1756,6 +1781,8 @@ protected File getClassesFile(MavenProject project) {
}

/**
* <p>getProjectSourceRoots.</p>
*
* @param p not null maven project
* @return the list of source paths for the given project
*/
Expand All @@ -1770,6 +1797,8 @@ protected List<String> getProjectSourceRoots(MavenProject p) {
}

/**
* <p>getExecutionProjectSourceRoots.</p>
*
* @param p not null maven project
* @return the list of source paths for the execution project of the given project
*/
Expand All @@ -1784,34 +1813,44 @@ protected List<String> getExecutionProjectSourceRoots(MavenProject p) {
}

/**
* <p>Getter for the field <code>javadocDirectory</code>.</p>
*
* @return the current javadoc directory
*/
protected File getJavadocDirectory() {
return javadocDirectory;
}

/**
* <p>Getter for the field <code>doclint</code>.</p>
*
* @return the doclint specific checks configuration
*/
protected String getDoclint() {
return doclint;
}

/**
* <p>Getter for the field <code>doctitle</code>.</p>
*
* @return the title to be placed near the top of the overview summary file
*/
protected String getDoctitle() {
return doctitle;
}

/**
* <p>Getter for the field <code>overview</code>.</p>
*
* @return the overview documentation file from the user parameter or from the <code>javadocdirectory</code>
*/
protected File getOverview() {
return overview;
}

/**
* <p>Getter for the field <code>windowtitle</code>.</p>
*
* @return the title to be placed in the HTML title tag
*/
protected String getWindowtitle() {
Expand Down Expand Up @@ -1841,6 +1880,7 @@ private String getEncoding() {
: encoding;
}

/** {@inheritDoc} */
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
verifyRemovedParameter("aggregator");
Expand All @@ -1851,8 +1891,19 @@ public void execute() throws MojoExecutionException, MojoFailureException {
doExecute();
}

/**
* <p>doExecute.</p>
*
* @throws org.apache.maven.plugin.MojoExecutionException if any.
* @throws org.apache.maven.plugin.MojoFailureException if any.
*/
protected abstract void doExecute() throws MojoExecutionException, MojoFailureException;

/**
* <p>verifyRemovedParameter.</p>
*
* @param paramName a {@link java.lang.String} object
*/
protected final void verifyRemovedParameter(String paramName) {
Xpp3Dom configDom = mojoExecution.getConfiguration();
if (configDom != null) {
Expand All @@ -1878,7 +1929,7 @@ private void verifyReplacedParameter(String oldParamName, String newParamNew) {
* Javadoc Options used by this Plugin.
*
* @param unusedLocale the wanted locale (actually unused).
* @throws MavenReportException if any
* @throws org.apache.maven.reporting.MavenReportException if any
*/
protected void executeReport(Locale unusedLocale) throws MavenReportException {
if (getLog().isDebugEnabled()) {
Expand Down Expand Up @@ -2087,7 +2138,7 @@ protected void executeReport(Locale unusedLocale) throws MavenReportException {
*
* @param sourcePaths a Collection that contains the paths to the source files
* @return a List that contains the specific path for every source file
* @throws MavenReportException {@link MavenReportException} issue while generating report
* @throws org.apache.maven.reporting.MavenReportException {@link org.apache.maven.reporting.org.apache.maven.reporting.MavenReportException} issue while generating report
*/
protected Map<Path, Collection<String>> getFiles(Collection<Path> sourcePaths) throws MavenReportException {
Map<Path, Collection<String>> mappedFiles = new LinkedHashMap<>(sourcePaths.size());
Expand Down Expand Up @@ -2128,7 +2179,7 @@ protected Map<Path, Collection<String>> getFiles(Collection<Path> sourcePaths) t
* source roots of the project will be used.
*
* @return a Map of the project absolute source paths per projects key (G:A)
* @throws MavenReportException {@link MavenReportException} issue while generating report
* @throws org.apache.maven.reporting.MavenReportException {@link org.apache.maven.reporting.org.apache.maven.reporting.MavenReportException} issue while generating report
* @see JavadocUtil#pruneDirs(MavenProject, Collection)
*/
protected Collection<JavadocModule> getSourcePaths() throws MavenReportException {
Expand Down Expand Up @@ -2279,18 +2330,20 @@ private Set<MavenProject> modulesForAggregatedProject(
/**
* Override this method to customize the configuration for resolving dependency sources. The default
* behavior enables the resolution of -sources jar files.
* @param config {@link SourceResolverConfig}
* @return {@link SourceResolverConfig}
*
* @param config {@link org.apache.maven.plugins.javadoc.resolver.SourceResolverConfig}
* @return {@link org.apache.maven.plugins.javadoc.resolver.SourceResolverConfig}
*/
protected SourceResolverConfig configureDependencySourceResolution(final SourceResolverConfig config) {
return config.withCompileSources();
}

/**
* Resolve dependency sources so they can be included directly in the javadoc process. To customize this,
* override {@link AbstractJavadocMojo#configureDependencySourceResolution(SourceResolverConfig)}.
* override {@link org.apache.maven.plugins.javadoc.AbstractJavadocMojo#configureDependencySourceResolution(SourceResolverConfig)}.
*
* @return List of source paths.
* @throws MavenReportException {@link MavenReportException}
* @throws org.apache.maven.reporting.MavenReportException {@link org.apache.maven.reporting.org.apache.maven.reporting.MavenReportException}
*/
protected final Collection<JavadocModule> getDependencySourcePaths() throws MavenReportException {
try {
Expand Down Expand Up @@ -2585,15 +2638,22 @@ private Collection<File> getPathElements() throws MavenReportException {
return classpathElements;
}

/**
* <p>getDependencyScopeFilter.</p>
*
* @return a {@link org.eclipse.aether.util.filter.ScopeDependencyFilter} object
*/
protected ScopeDependencyFilter getDependencyScopeFilter() {
return new ScopeDependencyFilter(
Arrays.asList(Artifact.SCOPE_COMPILE, Artifact.SCOPE_PROVIDED, Artifact.SCOPE_SYSTEM), null);
}

/**
* @param dependency {@link Dependency}
* @return {@link Artifact}
* @throws MavenReportException when artifact could not be resolved
* <p>resolveDependency.</p>
*
* @param dependency {@link org.apache.maven.model.Dependency}
* @return {@link org.apache.maven.artifact.Artifact}
* @throws org.apache.maven.reporting.MavenReportException when artifact could not be resolved
*/
public Artifact resolveDependency(Dependency dependency) throws MavenReportException {
ArtifactTypeRegistry registry = RepositoryUtils.newArtifactTypeRegistry(artifactHandlerManager);
Expand All @@ -2609,6 +2669,11 @@ public Artifact resolveDependency(Dependency dependency) throws MavenReportExcep
}
}

/**
* <p>getToolchain.</p>
*
* @return a {@link org.apache.maven.toolchain.Toolchain} object
*/
protected final Toolchain getToolchain() {
Toolchain tc = null;

Expand Down Expand Up @@ -5496,6 +5561,8 @@ private boolean matches(DependencyLink d, Artifact artifact) {
}

/**
* <p>getDefaultJavadocApiLink.</p>
*
* @return if {@code detectJavaApiLink}, the Java API link based on the {@code javaApiLinks} properties and the
* value of the <code>source</code> parameter in the
* <code>org.apache.maven.plugins:maven-compiler-plugin</code>
Expand Down Expand Up @@ -5632,6 +5699,8 @@ private Set<String> followLinks(Set<String> links) {
}

/**
* <p>isValidJavadocLink.</p>
*
* @param link not null
* @param detecting <code>true</code> if the link is generated by
* <code>detectLinks</code>, or <code>false</code> otherwise
Expand Down Expand Up @@ -5838,7 +5907,7 @@ private static String getPluginParameter(MavenProject project, String pluginId,
* Construct the output file for the generated javadoc-options XML file, after creating the
* javadocOptionsDir if necessary. This method does NOT write to the file in question.
*
* @return The options {@link File} file.
* @return The options {@link java.io.File} file.
* @since 2.7
*/
protected final File getJavadocOptionsFile() {
Expand All @@ -5854,8 +5923,8 @@ protected final File getJavadocOptionsFile() {
* 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}
* @return {@link org.apache.maven.plugins.javadoc.options.JavadocOptions}
* @throws java.io.IOException {@link java.io.java.io.IOException}
* @since 2.7
*/
protected final JavadocOptions buildJavadocOptions() throws IOException {
Expand Down Expand Up @@ -5914,14 +5983,21 @@ protected void logError(String message, Throwable t) {
}
}

/**
* <p>Getter for the field <code>reactorProjects</code>.</p>
*
* @return a {@link java.util.List} object
*/
protected List<MavenProject> getReactorProjects() {
return reactorProjects;
}

/**
* <p>failOnError.</p>
*
* @param prefix the prefix of the exception
* @param e the exception
* @throws MojoExecutionException {@link MojoExecutionException} issue while generating report
* @throws org.apache.maven.plugin.MojoExecutionException {@link org.apache.maven.plugin.org.apache.maven.plugin.MojoExecutionException} issue while generating report
*/
protected void failOnError(String prefix, Exception e) throws MojoExecutionException {
if (failOnError) {
Expand Down Expand Up @@ -5954,6 +6030,8 @@ private List<MavenProject> getAggregatedProjects() {
}

/**
* <p>isSkippedModule.</p>
*
* @param mavenProject the project that might be skipped
* @return <code>true</code> if the project needs to be skipped from aggregate generation
*/
Expand All @@ -5978,6 +6056,8 @@ protected boolean isSkippedModule(MavenProject mavenProject) {
}

/**
* <p>isSkippedJavadoc.</p>
*
* @param mavenProject the project that might be skipped
* @return <code>true</code> if the pom configuration skips javadoc generation for the project
*/
Expand Down
Loading
Loading