Package org.apache.maven.plugin.jxr
Class AbstractJxrReport
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.reporting.AbstractMavenReport
org.apache.maven.plugin.jxr.AbstractJxrReport
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.apache.maven.reporting.MavenMultiPageReport,org.apache.maven.reporting.MavenReport
- Direct Known Subclasses:
JxrReport,JxrTestReport
public abstract class AbstractJxrReport
extends org.apache.maven.reporting.AbstractMavenReport
Base class for the JXR reports.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringString used at the bottom of the Xref HTML files.private StringTitle of main page of the Xref HTML files.A list of exclude patterns to use.A list of include patterns to use.private org.codehaus.plexus.languages.java.version.JavaVersionVersion of the Javadoc templates to use.private StringVersion of the Javadoc templates to use.private booleanLink the Javadoc from the Source XRef.protected List<org.apache.maven.project.MavenProject> The projects in the reactor for aggregation report.private org.apache.maven.execution.MavenSessionprotected booleanWhether to skip this execution.private StringStyle sheet used for the Xref HTML files.private StringDirectory where Velocity templates can be found to generate overviews, frames and summaries.private StringTitle of window of the Xref HTML files.Fields inherited from class org.apache.maven.reporting.AbstractMavenReport
locale, mojoExecution, outputDirectory, outputFormat, outputTimestamp, project, remoteProjectRepositories, repoSession, siteDirectory, siteRenderer, siteToolFields inherited from interface org.apache.maven.reporting.MavenReport
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLEFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the list of the source directories to be included in the JXR report generationprivate voidCopy some required resources (like the stylesheet) to the given directoryprivate voidcopyResources(String dir, String sourceDirectory, String... files) Copy styles and related resources to the given directoryprivate voidcreateXref(Locale locale, String destinationDirectory, List<String> sourceDirs) Creates the Xref for the Java files found in the given source directory and puts them in the given destination directory.protected voidexecuteReport(Locale locale) private StringReturns the bottom text to be displayed at the lower part of the generated JXR reports.protected ResourceBundleReturns the correct resource bundle according to the locale.protected abstract StringAbstract method that returns the target directory where the generated JXR reports will be put.protected abstract FileAbstract method that returns the directory of the javadoc files.private Pathprotected org.apache.maven.project.MavenProjectprotected org.apache.maven.execution.MavenSessionReturns the Maven session.Abstract method that returns the specified source directories that will be included in the JXR report generation.getSourceRoots(org.apache.maven.project.MavenProject project) Abstract method that returns the compile source directories of the specified project that will be included in the JXR report generationprivate StringDetermine the templateDir to use, given javadocTemplatesVersionprivate booleanhasSources(File dir) Checks whether the given directory contains Java files.protected voidinit()Initialize some attributes required during the report generationprotected booleanIs the current report aggregated?booleanpruneSourceDirs(List<String> sourceDirs) Compiles the list of directories which contain source files that will be included in the JXR report generation.private voidSets a new value forjavadocTemplatesVersion.Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, constructXrefLocation, execute, generate, generate, getCategoryName, getInputEncoding, getLocale, getOutputDirectory, getOutputEncoding, getReportOutputDirectory, getSink, getSinkFactory, getSiteRenderer, getXrefLocation, setReportOutputDirectoryMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.reporting.MavenReport
getDescription, getName, getOutputName, getOutputPath
-
Field Details
-
session
@Parameter(defaultValue="${session}", readonly=true, required=true) private org.apache.maven.execution.MavenSession session -
windowTitle
Title of window of the Xref HTML files. -
docTitle
Title of main page of the Xref HTML files. -
bottom
@Parameter(property="bottom", defaultValue="Copyright © {inceptionYear}–{currentYear} {organizationName}. All rights reserved.") private String bottomString used at the bottom of the Xref HTML files. -
templateDir
Directory where Velocity templates can be found to generate overviews, frames and summaries. Should not be used. If used, should be an absolute path, like"${basedir}/myTemplates". -
stylesheet
Style sheet used for the Xref HTML files. Should not be used. If used, should be an absolute path, like"${basedir}/myStyles.css". -
excludes
A list of exclude patterns to use. By default no files are excluded.- Since:
- 2.1
-
includes
A list of include patterns to use. By default all .java files are included.- Since:
- 2.1
-
reactorProjects
@Parameter(defaultValue="${reactorProjects}", readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjectsThe projects in the reactor for aggregation report. -
skip
@Parameter(property="maven.jxr.skip", defaultValue="false") protected boolean skipWhether to skip this execution.- Since:
- 2.3
-
linkJavadoc
@Parameter(defaultValue="true") private boolean linkJavadocLink the Javadoc from the Source XRef. Defaults to true and will link automatically if javadoc plugin is being used. -
javadocVersion
Version of the Javadoc templates to use. The value should reflect `java.specification.version`, "1.4", "1.8", "9", "10", by default this system property is used. -
javadocTemplatesVersion
private org.codehaus.plexus.languages.java.version.JavaVersion javadocTemplatesVersionVersion of the Javadoc templates to use.
-
-
Constructor Details
-
AbstractJxrReport
public AbstractJxrReport()
-
-
Method Details
-
pruneSourceDirs
Compiles the list of directories which contain source files that will be included in the JXR report generation.- Parameters:
sourceDirs- the List of the source directories- Returns:
- a List of the directories that will be included in the JXR report generation
-
init
protected void init()Initialize some attributes required during the report generation -
hasSources
Checks whether the given directory contains Java files.- Parameters:
dir- the source directory- Returns:
- true if the directory or one of its subdirectories contains at least 1 Java file
-
createXref
private void createXref(Locale locale, String destinationDirectory, List<String> sourceDirs) throws IOException, JxrException Creates the Xref for the Java files found in the given source directory and puts them in the given destination directory.- Parameters:
locale- The user locale to use for the Xref generationdestinationDirectory- The output directorysourceDirs- The source directories- Throws:
IOExceptionJxrException
-
getBottomText
Returns the bottom text to be displayed at the lower part of the generated JXR reports. -
copyRequiredResources
Copy some required resources (like the stylesheet) to the given directory- Parameters:
dir- the directory to copy the resources to
-
copyResources
Copy styles and related resources to the given directory- Parameters:
dir- the directory to copy the resources tosourceDirectory- resources subdirectory to copy fromfiles- names of files to copy
-
getProject
protected org.apache.maven.project.MavenProject getProject()- Overrides:
getProjectin classorg.apache.maven.reporting.AbstractMavenReport
-
getSession
protected org.apache.maven.execution.MavenSession getSession()Returns the Maven session.- Returns:
- Maven session
-
getBundle
Returns the correct resource bundle according to the locale.- Parameters:
locale- the locale of the user- Returns:
- the bundle corresponding to the locale
-
executeReport
- Specified by:
executeReportin classorg.apache.maven.reporting.AbstractMavenReport- Throws:
org.apache.maven.reporting.MavenReportException
-
getTemplateDir
Determine the templateDir to use, given javadocTemplatesVersion- Returns:
-
setJavadocTemplatesVersion
private void setJavadocTemplatesVersion()Sets a new value forjavadocTemplatesVersion. -
constructSourceDirs
Gets the list of the source directories to be included in the JXR report generation- Returns:
- a List of the source directories whose contents will be included in the JXR report generation
-
canGenerateReport
public boolean canGenerateReport()- Specified by:
canGenerateReportin interfaceorg.apache.maven.reporting.MavenReport- Overrides:
canGenerateReportin classorg.apache.maven.reporting.AbstractMavenReport
-
isExternalReport
public boolean isExternalReport()- Specified by:
isExternalReportin interfaceorg.apache.maven.reporting.MavenReport- Overrides:
isExternalReportin classorg.apache.maven.reporting.AbstractMavenReport
-
getJavadocLocation
- Returns:
- a String that contains the location of the javadocs
- Throws:
IOException
-
getDestinationDirectory
Abstract method that returns the target directory where the generated JXR reports will be put.- Returns:
- a String that contains the target directory name
-
getSourceRoots
Abstract method that returns the specified source directories that will be included in the JXR report generation.- Returns:
- a List of the source directories
-
getSourceRoots
Abstract method that returns the compile source directories of the specified project that will be included in the JXR report generation- Parameters:
project- the MavenProject where the JXR report plugin will be executed- Returns:
- a List of the source directories
-
getJavadocDir
Abstract method that returns the directory of the javadoc files.- Returns:
- a File for the directory of the javadocs
-
isAggregate
protected boolean isAggregate()Is the current report aggregated?- Returns:
- true if aggregate, false otherwise
-