Class ChangelogMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
-
- com.github.koraktor.mavanagaiata.mojo.AbstractGitOutputMojo
-
- com.github.koraktor.mavanagaiata.mojo.ChangelogMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="changelog", defaultPhase=PROCESS_RESOURCES, threadSafe=true) public class ChangelogMojo extends AbstractGitOutputMojoThis goal allows to generate a changelog of the currently checked out branch of the Git repository. It will use information from tags and commit messages to build a reverse chronological summary of the development. It can be configured to display the changelog or save it to a file.- Since:
- 0.2.0
- Author:
- Sebastian Staudt
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classChangelogMojo.ChangelogWalkAction(package private) static classChangelogMojo.LinkToBaseUrlPre-defined base URLs used for links
-
Field Summary
Fields Modifier and Type Field Description protected ChangelogFormatformatThe format to use while generating the changelog(package private) ChangelogFormat.FormatsformatTemplateThe formatting template to use while generating the changelog(package private) ChangelogMojo.LinkToBaseUrllinkToUsed to select the service to create links to(package private) StringlinkToBaseUrlCan be used to override the pre-defined URLs fromlinkTowith a customized URL(package private) StringlinkToProjectThe project name for GitHub links(package private) StringlinkToUserThe user name for GitHub linksprotected FileoutputFileThe file to write the changelog to(package private) StringskipCommitsMatchingWhether to skip commits that match the given regular expressionprivate PatternskipCommitsPattern(package private) booleanskipMergeCommitsWhether to skip merge commits’ messages(package private) booleanskipTaggedWhether to skip tagged commits' messages
This is useful when usually tagging commits like "Version bump to X.Y.Z"-
Fields inherited from class com.github.koraktor.mavanagaiata.mojo.AbstractGitOutputMojo
encoding, footer, printStream
-
Fields inherited from class com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
baseDir, dateFormat, dirtyFlag, dirtyIgnoreUntracked, failGracefully, gitDir, head, project, propertyPrefixes, skip, skipNoGit
-
-
Constructor Summary
Constructors Constructor Description ChangelogMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegetOutputFile()Returns the output file for the generated changelogprotected voidinitConfiguration()voidsetOutputFile(File outputFile)Sets the output file for the generated changelogprotected voidwriteOutput(GitRepository repository)Walks through the history of the currently checked out branch of the Git repository and builds a changelog from the commits contained in that branch.-
Methods inherited from class com.github.koraktor.mavanagaiata.mojo.AbstractGitOutputMojo
createPrintStream, generateOutput, init, run, unescapeFormatNewlines
-
Methods inherited from class com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
addProperty, execute, initRepository, prepareParameters
-
-
-
-
Field Detail
-
format
@Parameter(property="mavanagaiata.changelog.format") protected ChangelogFormat format
The format to use while generating the changelog- Since:
- 0.9.0
- See Also:
formatTemplate
-
formatTemplate
@Parameter(property="mavanagaiata.changelog.formatTemplate", defaultValue="DEFAULT") ChangelogFormat.Formats formatTemplateThe formatting template to use while generating the changelogThis may be one of
DEFAULTorMARKDOWN.Individual attributes may be overridden using
format.- Since:
- 0.9.0
-
linkToProject
@Parameter(property="mavanagaiata.changelog.linkToProject") String linkToProject
The project name for GitHub links- Since:
- 0.9.0
-
linkToUser
@Parameter(property="mavanagaiata.changelog.linkToUser") String linkToUser
The user name for GitHub links- Since:
- 0.9.0
-
linkTo
@Parameter(property="mavanagaiata.changelog.linkTo", defaultValue="GITHUB") ChangelogMojo.LinkToBaseUrl linkToUsed to select the service to create links toGITHUBandGITLABare available.- Since:
- 0.9.0
-
linkToBaseUrl
@Parameter(property="mavanagaiata.changelog.linkToBaseUrl") String linkToBaseUrl
Can be used to override the pre-defined URLs fromlinkTowith a customized URL- Since:
- 0.9.0
-
outputFile
@Parameter(property="mavanagaiata.changelog.outputFile") protected File outputFile
The file to write the changelog to- Since:
- 0.4.1
-
skipMergeCommits
@Parameter(property="mavanagaiata.changelog.skipMergeCommits", defaultValue="true") boolean skipMergeCommitsWhether to skip merge commits’ messages- Since:
- 0.9.0
-
skipTagged
@Parameter(property="mavanagaiata.changelog.skipTagged", defaultValue="false") boolean skipTaggedWhether to skip tagged commits' messages
This is useful when usually tagging commits like "Version bump to X.Y.Z"
-
skipCommitsMatching
@Parameter(property="mavanagaiata.changelog.skipCommitsMatching") String skipCommitsMatching
Whether to skip commits that match the given regular expression- Since:
- 0.8.0
-
skipCommitsPattern
private Pattern skipCommitsPattern
-
-
Method Detail
-
writeOutput
protected void writeOutput(GitRepository repository) throws MavanagaiataMojoException
Walks through the history of the currently checked out branch of the Git repository and builds a changelog from the commits contained in that branch.- Specified by:
writeOutputin classAbstractGitOutputMojo- Parameters:
repository- The repository the mojo is running in- Throws:
MavanagaiataMojoException- if retrieving information from the Git repository fails
-
getOutputFile
public File getOutputFile()
Returns the output file for the generated changelog- Specified by:
getOutputFilein classAbstractGitOutputMojo- Returns:
- The output file for the generated changelog
-
initConfiguration
protected void initConfiguration()
- Overrides:
initConfigurationin classAbstractGitOutputMojo
-
setOutputFile
public void setOutputFile(File outputFile)
Sets the output file for the generated changelog- Specified by:
setOutputFilein classAbstractGitOutputMojo- Parameters:
outputFile- The output file for the generated changelog
-
-