Class ContributorsMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="contributors",
          defaultPhase=PROCESS_RESOURCES,
          threadSafe=true)
    public class ContributorsMojo
    extends AbstractGitOutputMojo
    This goal allows to generate a list of contributors for the currently checked out branch of the Git repository. It will list all authors of the commits in this branch. It can be configured to display the changelog or save it to a file.
    Since:
    0.2.0
    Author:
    Sebastian Staudt
    • Field Detail

      • MARKDOWN_TRANSLATOR

        private static final org.apache.commons.text.translate.CharSequenceTranslator MARKDOWN_TRANSLATOR
      • contributorPrefix

        @Parameter(property="mavanagaiata.contributors.contributorPrefix",
                   defaultValue=" * ")
        String contributorPrefix
        The string to prepend to every contributor name
      • escapeHtml

        @Parameter(property="mavanagaiata.contributors.escapeHtml",
                   defaultValue="false")
        boolean escapeHtml
      • escapeMarkdown

        @Parameter(property="mavanagaiata.contributors.escapeMarkdown",
                   defaultValue="false")
        boolean escapeMarkdown
      • header

        @Parameter(property="mavanagaiata.contributors.header",
                   defaultValue="Contributors\n============\n")
        String header
        The header to print above the changelog
      • outputFile

        @Parameter(property="mavanagaiata.contributors.outputFile")
        File outputFile
        The file to write the contributors list to
      • showCounts

        @Parameter(property="mavanagaiata.contributors.showCounts",
                   defaultValue="true")
        boolean showCounts
        Whether the number of contributions should be listed
      • showEmail

        @Parameter(property="mavanagaiata.contributors.showEmail",
                   defaultValue="false")
        boolean showEmail
        Whether the email addresses of contributors should be listed
      • sort

        @Parameter(property="mavanagaiata.contributors.sort",
                   defaultValue="count")
        String sort
        The method used to sort contributors

        Available values are count, date and name.

    • Constructor Detail

      • ContributorsMojo

        public ContributorsMojo()
    • Method Detail

      • escapeName

        private String escapeName​(String name)
        Returns an escaped form of the contributor name

        Depending on the escapeHtml and escapeMarkdown fields this methods escapes HTML tags and/or Markdown link brackets.

        Parameters:
        name - The name of the contributor
        Returns:
        An escaped form of the contributor
      • getOutputFile

        public File getOutputFile()
        Returns the output file for the generated contributors list
        Specified by:
        getOutputFile in class AbstractGitOutputMojo
        Returns:
        The output file for the generated contributors list
      • setOutputFile

        public void setOutputFile​(File outputFile)
        Sets the output file for the generated contributors list
        Specified by:
        setOutputFile in class AbstractGitOutputMojo
        Parameters:
        outputFile - The output file for the generated contributors list