danielflower / maven-gitlog-plugin

Generates a change log for maven projects using git
55 stars 34 forks source link

Add dynamic loading loading mechanism for CommitFilters. #19

Closed imartinezortiz closed 10 years ago

imartinezortiz commented 10 years ago

This PR uses the SPI mechanism provided by the JRE to load all implementing classes of the CommitFilter interface. This way it is possible to add a dependency to the plugin configuration in order add new filters dynamically. For example, using the following configuration:

<plugin>
  <groupId>com.github.danielflower.mavenplugins</groupId>
  <artifactId>maven-gitlog-plugin</artifactId>
  <version>1.5.3-SNAPSHOT</version>
  <configuration>
    <generateSimpleHTMLChangeLog>false</generateSimpleHTMLChangeLog>
    <generatePlainTextChangeLog>true</generatePlainTextChangeLog>
  </configuration>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>generate</goal>
      </goals>
    </execution>
  </executions>
  <dependencies>
    <dependency>
      <groupId>es.e-ucm.ead</groupId>
      <artifactId>gitlog-maven-plugin-ext</artifactId>
      <version>0.0.1-SNAPSHOT</version>
    </dependency>
  </dependencies>
</plugin>

loads the CommitFilters of the es.e-ucm.ead:gitlog-maven-plugin-ext maven artifact.

danielflower commented 10 years ago

Interesting, hadn't seen this before. Thanks.