Coder Social home page Coder Social logo

maven-gitlog-plugin's Introduction

Overview

This plugin allows the creation of text and HTML changelogs based on the git log. During the Maven packaging phase this plugin can generate plaintext and HTML reports showing all the commits (with tags) from the local git repository. These text files can then be sent to a web server or included during packaging.

Sample output

Using the default plugin parameters, the changelog for this project looks like the following:

HTML example / Text example

Configuring the plugin

Add the following to your <plugins> section in your pom.xml file to generate changelog.txt and changelog.html in your target folder:

<plugin>
	<groupId>com.github.danielflower.mavenplugins</groupId>
	<artifactId>maven-gitlog-plugin</artifactId>
	<version>1.4.7</version>
	<executions>
		<execution>
			<goals>
				<goal>generate</goal>
			</goals>
		</execution>
	</executions>
</plugin>

HTML reports will render issue codes as links if you have your issue tracking system is defined in your pom file. Currently only Jira and GitHub issue tracking is supported.

<issueManagement>
	<system>GitHub</system>
	<url>https://github.com/danielflower/maven-gitlog-plugin/issues</url>
</issueManagement>

The following example shows all the possible configuration values with default values overridden.

<plugin>
	<groupId>com.github.danielflower.mavenplugins</groupId>
	<artifactId>maven-gitlog-plugin</artifactId>
	<version>1.4.7</version>
	<configuration>
		<reportTitle>Changelog for ${project.name} version ${project.version}</reportTitle>
		<verbose>true</verbose>
		<outputDirectory>target/docs</outputDirectory>
		<generatePlainTextChangeLog>true</generatePlainTextChangeLog>
		<plainTextChangeLogFilename>changelog-${project.version}.txt</plainTextChangeLogFilename>
		<generateSimpleHTMLChangeLog>true</generateSimpleHTMLChangeLog>
		<simpleHTMLChangeLogFilename>changelog-${project.version}.html</simpleHTMLChangeLogFilename>
		<generateHTMLTableOnlyChangeLog>true</generateHTMLTableOnlyChangeLog>
		<htmlTableOnlyChangeLogFilename>changelog-${project.version}-tableonly.html</htmlTableOnlyChangeLogFilename>
		<issueManagementSystem>GitHub issue tracker</issueManagementSystem>
		<issueManagementUrl>https://github.com/danielflower/maven-gitlog-plugin/issues</issueManagementUrl>
	</configuration>
	<executions>
		<execution>
			<goals>
				<goal>generate</goal>
			</goals>
		</execution>
	</executions>
</plugin>

Including the changelog in your Maven assembly

If you want to include the changelogs in your assembled package, then you will need to configure the Maven assembly plugin to use a custom descriptor. The following is an example of a descriptor that creates a zip file which includes the two changelog reports in the docs folder of the zip file:

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
		  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
	<id>full</id>
	<formats>
		<format>zip</format>
	</formats>
	<includeBaseDirectory>false</includeBaseDirectory>
	<dependencySets>
		<dependencySet>
			<outputDirectory>/libs</outputDirectory>
			<useProjectArtifact>true</useProjectArtifact>
			<scope>runtime</scope>
		</dependencySet>
	</dependencySets>
	<fileSets>
		<fileSet>
			<directory>target</directory>
			<includes>
				<include>changelog.*</include>
			</includes>
			<outputDirectory>docs</outputDirectory>
		</fileSet>
	</fileSets>
</assembly>

Showing the git changelog for your current project

If your project has a reference to the gitlog plugin already, the following command will print a changelog to the command line:

$ mvn gitlog:show

If you want to see a git log without having the plugin defined in your pom, you can run:

$ mvn com.github.danielflower.mavenplugins:maven-gitlog-plugin:show

maven-gitlog-plugin's People

Contributors

danielflower avatar

Stargazers

Ryan Gardner avatar

Watchers

Ryan Gardner avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.