This is a sample Maven project with a Jenkinsfile for doing gitflow based release management.
The Jenkinsfile is used by Jenkins to build a pipeline with the described steps. Actual gitflow release management is performed by jgitflow-maven-plugin maven plugin.
In order to fully use the gitflow for a project, it is better to create a Multibranch Pipeline job. For each branch, Jenkins will create a separate pipeline from the Jenkinsfile, available in the branch. Note that I was able to have avoid multiple problems with flow by specifying the Wipe out repository & force clone additional behaviour for the job.