I'm trying to work out the optimal way of managing my workflow to allow version numbering and releases with Maven and Git.
Currently my workflow is:
I do all the work in the "master" branch unless I need to do something experimental (in which case I switch to a new branch, merging periodically)
Is this a sensible workflow? Any ways that I could improve it.
Use the maven-release plugin which is supposed to do that for you. Releases involve two steps:
mvn release:prepare
which will ask you for the released version, tag name, and next development versionmvn release:perform
which will build the release artifacts and publish them on a remote maven repositoryTo make this work, you have to configure in your pom file several things:
<scm>
<connection>scm:git:git://github.com/user/repo.git</connection>
<developerConnection>scm:git:[email protected]:user/repo.git</developerConnection>
<url>https://github.com/user/repo/tree/master/</url>
</scm>
release:perform
will upload the built artifactsWhile you're at it, you should set up a GPG key that should be used for signing tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With