Introduction

Overview

We have tried to make this plugin extensible to be adaptable. There are three ways to extend it:

  • add grammars.
  • add bug trackers.
  • add other scm.

How does it work?

Well it is quite simple:

  1. we build the scm connection in the same way as the maven-scm-plugin. So, in theory, it should be possibleo use others SCM, provided you override the two commands we use to produce our expected elements.
  2. we do a list command on the tags repository. This gives us a list of tags (that we are considering as releases).
  3. for each tag, we execute a log command between its startrevision and end revision. This way we get a list of log entries.
  4. we parse thelog entries. Those who match the grammar's patterns give us a list of Messages.
  5. we build the report with this list of issues.

Extensions

Bug Tracker

The bug trackers are defined in the class org.codehaus.mojo.scmchangelog.tracker.BugTrackers. They implement the interface org.codehaus.mojo.scmchangelog.tracker.BugTrackLinker whose only method is here to provide a link to the bug description for this bug tracker with the bug id as parameter.
We provide three examples of bug trackers: SourceForge, JIRA, and Bugzilla. Our bug trackers use the issue management url from the pom, but you can also define your own through the plugin's configuration.

Grammar

The grammars are defined in the class org.codehaus.mojo.scmchangelog.changelog.log.GrammarEnum. They implement the interface org.codehaus.mojo.scmchangelog.changelog.log.SvnGrammar with three methods:

  • Message extractMessage( String content ): where we extract the issues from the comment.
  • boolean hasMessage( String content ): where we test for issues from the comment. If none is found the comment will ignored.
  • String getIssueSeparator(): which returns the separator of issue comment, if the comment is about several issues.
We provide two examples of grammar: org.codehaus.mojo.scmchangelog.changelog.log.grammar.ManuSvnGrammar and org.codehaus.mojo.scmchangelog.changelog.log.grammar.RemySvnGrammar. They are extensions of org.codehaus.mojo.scmchangelog.changelog.log.grammar.AbstractSvnGrammar, a helper class for regexp based grammars.

SCM

To be frank, I don't know how hard it would be to use another SCM. We are using Maven's SCM API to be independant from the SCM. To be able to use another SCM, one would have to provide the command and the consumer for the list and changelog commands. And we would have to update the code so that our ScmProviders would be used instead of those of the SCM API.

The changelog command must be modified to return a list of BetterChangeSet instead of a list of ChangeSet. This is because ChangeSet doesn't store the revision number.