Relative Content

Tag Archive for mavenpom.xml

Simplest way to generate version string for Maven package from Git branch

I want to automate the version string generation for release builds of my Java project. My pom.xml has a <version>${my-version-property}</version tag and the Git branch is called e.g. release/1.0.2. How do I extract “1.0.2” from the branch name, so that I can use it as a property in downstream project dependency tags and in the <finalName> for the maven-war-plugin?

Change Maven Repository Order

Our enterprise team maintains a settings.xml file that defines various repositories that development teams can use with Maven to build their artifacts.