Difficulty: Beginner
Estimated Time: 10 minutes

Welcome to this jgitver maven demo.

In this tutorial, you will see how to integrate jgitver into an existing maven project.

jgitver will allow automatic project version computation based on git information (tags, commits, branches, ...)

jgitver maven simple usage

For now let's move to the next slide.

You're done, you have successfully used jgitver and its jgitver-maven-plugin: congratulations!

Feel free now to:

jgitver Maven introduction on docker

Step 1 of 3

project 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

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 && \ git add . && \ git commit -m "initial version"

We now have a default running maven project

mvn validate

which version is defined by the pom version node as 1.0.0-SNAPSHOT

grep -E --color=auto '^.*1.0.0-SNAPSHOT.*$|$' pom.xml

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

This tab will not be visible to users.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]