Maven archetype for quick-start projects
Create a new maven project:
mvn archetype:generate -DarchetypeGroupId=com.a9ski.archetypes -DarchetypeArtifactId=quick-start
- Install pre-commit (https://pre-commit.com/)
- Install the pre-commit hook by executing
pre-commit install
inside project directory - Run against all files in the project:
pre-commit run --all-files
brew install gh
mvn release:prepare
it will perform following steps:
- Check that there are no uncommitted changes in the sources
- Check that there are no SNAPSHOT dependencies
- Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
- Transform the SCM information in the POM to include the final destination of the tag
- Run the project tests against the modified POMs to confirm everything is in working order
- Commit the modified POMs
- Tag the code in the SCM with a version name.
- Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
- Commit the modified POMs
TAG=$(cat release.properties | grep scm.tag= | sed s/scm.tag=//g) && gh release create $TAG --title $TAG --notes-file release-notes/$TAG.txt
mvn release:clean
to delete release descriptor and POM backups.
Go to https://oss.sonatype.org/#stagingRepositories and find the repository. Next choose to close. After being closed click the release button.
If the release.properties
file is present
gh release delete v1.0.0
mvn release:rollback
git rebase -i HEAD~4 # squash the release commits
git push --force
If the release.properties
file is missing
mvn release:clean
gh release delete v1.0.0
git tag -d v1.0.0
git push --delete origin v1.0.0
#!!! Change pom.xml and decrement the version number
git commit --amend
git rebase -i HEAD~3 # squash the release commits
git push --force