Difficulty: Intermediate
Estimated Time: 10 minutes

Welcome to this jgitver maven demo.

In this tutorial, you will see how to start changing jgitver configuration by creating & modifying a .mvn/jgitver.config.xml file.

For now let's move to the next slide.

We have successfully added specific configuration to jgitver.

There is a lot more that can be configured in jgitver, please read and follow the documentation.

Play with jgitver configuration for Apache Maven

Step 1 of 2

Initialization

Open a docker container with all the required tooling: maven, git.

docker run -it --rm maven:3.5 /bin/bash

Let's create a default maven project.

mvn archetype:generate \ -DgroupId=fr.brouillard.jgitver.demos \ -DartifactId=simple-maven-demo \ -Dversion=1.0.0-SNAPSHOT \ -Dpackage=fr.brouillard.jgitver.demos \ -DarchetypeArtifactId=maven-archetype-quickstart \ -DinteractiveMode=false \ -DarchetypeCatalog=local

With some git history and jgitver installed

cd simple-maven-demo && \ git init && \ git config user.name "Scrap Kata-Coda" && \ git config user.email "[email protected]" && \ git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" && \ echo target/ > .gitignore && \ sh -c "$(wget -q https://git.io/fA6sj -O -)" && \ git add . && \ git commit -m "initial version"

We now have a default running maven project with jgitver working with it's defaults parameters.

mvn validate

should output that jgitver is in action and project version calculated as 0.0.0-SNAPSHOT