Class ChangeLogReport
- 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:
DeveloperActivityReport,FileActivityReport
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected List<org.apache.maven.model.Developer> List of developers to be shown on the report.protected StringA template string that is used to create the changeset URL.protected StringA template string that is used to create the URL to the file details.protected StringA template string that is used to create the revision aware URL to the file details in a similar fashion to thedisplayFileDetailUrl.protected booleanEncodes slashes in file uri.protected StringThe URL to view the scm.protected booleanSkip the Changelog report generation.Fields inherited from class org.apache.maven.reporting.AbstractMavenReport
outputDirectory, siteRendererFields 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 TypeMethodDescriptionbooleanvoidcheckResult(org.apache.maven.scm.ScmResult result) protected longcountFilesChanged(Collection<org.apache.maven.scm.ChangeSet> entries) counts the number of files that were changed in the specified SCMprotected voiddoChangeSetTitle(org.apache.maven.scm.command.changelog.ChangeLogSet set, ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink) Generate the title for the report.protected voiddoGenerateEmptyReport(ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink) generates an empty report in case there are no sources to generate a report withprotected voiddoGenerateReport(List<org.apache.maven.scm.command.changelog.ChangeLogSet> changeLogSets, ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink) method that generates the report for this mojo.protected voiddoSummary(org.apache.maven.scm.command.changelog.ChangeLogSet set, ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink) Generate the summary section of the report.voidexecuteReport(Locale locale) protected List<org.apache.maven.scm.command.changelog.ChangeLogSet> creates a ChangeLog object and then connects to the SCM to generate the changed setsprotected voidgenerateLinks(String connection, String name, String revision, org.apache.maven.doxia.sink.Sink sink) attaches the http links from the changed filesprotected voidgenerateLinks(String connection, String name, org.apache.maven.doxia.sink.Sink sink) attaches the http links from the changed filesprotected ResourceBundleprotected List<org.apache.maven.scm.command.changelog.ChangeLogSet> Populates the changedSets field by either connecting to the SCM or using an existing XML generated in a previous run of the reportprotected Stringused to retrieve the SCM connection stringgetDescription(Locale locale) protected Stringprotected StringGets the effective reporting output files encoding.protected org.apache.maven.project.MavenProjectorg.apache.maven.scm.repository.ScmRepositoryprotected org.apache.maven.doxia.siterenderer.Rendererprotected voidpopulates the report url used to create links from certain elements of the reportprotected voidsinkAuthorDetails(org.apache.maven.doxia.sink.Sink sink, String author) If the supplied author is a known developer this method outputs a link to the team members report, or alternatively, if the supplied author is unknown, outputs the author's name as plain text.Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, execute, generate, generate, generate, getCategoryName, getInputEncoding, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectoryMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
DEFAULT_ISSUE_ID_REGEX_PATTERN
- See Also:
-
scmUrl
The URL to view the scm. Basis for external links from the generated report. -
skip
@Parameter(property="changelog.skip", defaultValue="false") protected boolean skipSkip the Changelog report generation. Most useful on the command line via "-Dchangelog.skip=true".- Since:
- 2.3
-
encodeFileUri
@Parameter(property="encodeFileUri", defaultValue="false") protected boolean encodeFileUriEncodes slashes in file uri. Required for some repository browsers like gitblit- Since:
- 2.3
-
displayFileDetailUrl
@Parameter(property="displayFileDetailUrl", defaultValue="${project.scm.url}") protected String displayFileDetailUrlA template string that is used to create the URL to the file details. There is a special token that you can use in your template:%FILE%- this is the path to a file
Example:
http://checkstyle.cvs.sourceforge.net/checkstyle%FILE%?view=markupNote: If you don't supply the token in your template, the path of the file will simply be appended to your template URL.
-
displayChangeSetDetailUrl
A template string that is used to create the changeset URL. If not defined no change set link will be created.
There is one special token that you can use in your template:%REV%- this is the changeset revision
Example:
http://fisheye.sourceforge.net/changelog/a-project/?cs=%REV%Note: If you don't supply the %REV% token in your template, the revision will simply be appended to your template URL.
- Since:
- 2.2
-
displayFileRevDetailUrl
A template string that is used to create the revision aware URL to the file details in a similar fashion to the
displayFileDetailUrl. When a report contains both file and file revision information, as in the Change Log report, this template string can be used to create a revision aware URL to the file details.If not defined this template string defaults to the same value as the
There are two special tokens that you can use in your template:displayFileDetailUrland thus revision number aware links will not be used.%FILE%- this is the path to a file%REV%- this is the revision of the file
Example:
http://fisheye.sourceforge.net/browse/a-project/%FILE%?r=%REV%Note: If you don't supply the %FILE% token in your template, the path of the file will simply be appended to your template URL.
- Since:
- 2.2
-
developers
@Parameter(property="project.developers") protected List<org.apache.maven.model.Developer> developersList of developers to be shown on the report.- Since:
- 2.2
-
-
Constructor Details
-
ChangeLogReport
public ChangeLogReport()
-
-
Method Details
-
executeReport
- Specified by:
executeReportin classorg.apache.maven.reporting.AbstractMavenReport- Throws:
org.apache.maven.reporting.MavenReportException
-
getChangedSets
protected List<org.apache.maven.scm.command.changelog.ChangeLogSet> getChangedSets() throws org.apache.maven.reporting.MavenReportExceptionPopulates the changedSets field by either connecting to the SCM or using an existing XML generated in a previous run of the report- Returns:
- a List of ChangeLogSets
- Throws:
org.apache.maven.reporting.MavenReportException- if any exception occurs
-
generateChangeSetsFromSCM
protected List<org.apache.maven.scm.command.changelog.ChangeLogSet> generateChangeSetsFromSCM() throws org.apache.maven.reporting.MavenReportExceptioncreates a ChangeLog object and then connects to the SCM to generate the changed sets- Returns:
- changedlogsets generated from the SCM
- Throws:
org.apache.maven.reporting.MavenReportException- if any exception occurs
-
getScmRepository
public org.apache.maven.scm.repository.ScmRepository getScmRepository() throws org.apache.maven.scm.ScmException- Throws:
org.apache.maven.scm.ScmException
-
checkResult
public void checkResult(org.apache.maven.scm.ScmResult result) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
getConnection
used to retrieve the SCM connection string- Returns:
- the url string used to connect to the SCM
- Throws:
org.apache.maven.reporting.MavenReportException- when there is insufficient information to retrieve the SCM connection string
-
doGenerateEmptyReport
generates an empty report in case there are no sources to generate a report with- Parameters:
bundle- the resource bundle to retrieve report phrases fromsink- the report formatting tool
-
doGenerateReport
protected void doGenerateReport(List<org.apache.maven.scm.command.changelog.ChangeLogSet> changeLogSets, ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink) method that generates the report for this mojo. This method is overridden by dev-activity and file-activity mojo- Parameters:
changeLogSets- changed sets to generate the report frombundle- the resource bundle to retrieve report phrases fromsink- the report formatting tool
-
doChangeSetTitle
protected void doChangeSetTitle(org.apache.maven.scm.command.changelog.ChangeLogSet set, ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink) Generate the title for the report.- Parameters:
set- change set to generate the report frombundle- the resource bundle to retrieve report phrases fromsink- the report formatting tool
-
doSummary
protected void doSummary(org.apache.maven.scm.command.changelog.ChangeLogSet set, ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink) Generate the summary section of the report.- Parameters:
set- change set to generate the report frombundle- the resource bundle to retrieve report phrases fromsink- the report formatting tool
-
countFilesChanged
counts the number of files that were changed in the specified SCM- Parameters:
entries- a collection of SCM changes- Returns:
- number of files changed for the changedsets
-
sinkAuthorDetails
If the supplied author is a known developer this method outputs a link to the team members report, or alternatively, if the supplied author is unknown, outputs the author's name as plain text.- Parameters:
sink- Sink to use for outputtingauthor- The author's name.
-
initReportUrls
protected void initReportUrls()populates the report url used to create links from certain elements of the report -
generateLinks
attaches the http links from the changed files- Parameters:
connection- the string used to connect to the SCMname- filename of the file that was changedsink- the report formatting tool
-
generateLinks
protected void generateLinks(String connection, String name, String revision, org.apache.maven.doxia.sink.Sink sink) attaches the http links from the changed files- Parameters:
connection- the string used to connect to the SCMname- filename of the file that was changedrevision- the revision codesink- the report formatting tool
-
getProject
protected org.apache.maven.project.MavenProject getProject()- Overrides:
getProjectin classorg.apache.maven.reporting.AbstractMavenReport
-
getOutputDirectory
- Overrides:
getOutputDirectoryin classorg.apache.maven.reporting.AbstractMavenReport
-
getOutputEncoding
Gets the effective reporting output files encoding.- Overrides:
getOutputEncodingin classorg.apache.maven.reporting.AbstractMavenReport- Returns:
- The effective reporting output file encoding, never
null.
-
getSiteRenderer
protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()- Overrides:
getSiteRendererin classorg.apache.maven.reporting.AbstractMavenReport
-
getDescription
-
getName
-
getOutputName
-
getBundle
- Parameters:
locale- the locale for thescm-activityresource bundle- Returns:
- the current bundle
-
canGenerateReport
public boolean canGenerateReport()- Specified by:
canGenerateReportin interfaceorg.apache.maven.reporting.MavenReport- Overrides:
canGenerateReportin classorg.apache.maven.reporting.AbstractMavenReport
-