personal-accounting
A skeleton project used as a template for creating java libraries.
Features
- Imports commonly-used java libraries
- Configures the project and IDEs for code generation using Immutables
- Configures CircleCI to;
- Build all commits of the project
- Upload jUnit test results and all report artifacts
- Upload code coverage analysis to CodeClimate
- Publish commits on
develop
as snapshots to the maven central sanpshots repository - Publish commits tagged with a version as staged releases to the maven central staging repository
- Automatically close and release staged releases to maven central using the Gradle Nexus Staging plugin
README
pre-formatted with some handy shields- Perform releases and manage version numbers using the Gradle Sonatype Nexus plugin
Usage
-
If you have not configured open source repository hosting follow these instructions, specifying a
groupId
ofio.github.<your-github-username>
. You will need to wait a few hours for this ticket to be completed before pushing any changes. -
Clone this repository to a new folder
git clone git@github.com:clormor/personal-accounting.git <my-new-project> && cd <my-project>
-
Update the project name in all places where it is referenced
./scripts/rename-project.sh personal-accounting <my-new-project>
-
Update the
modifyPom
closure inbuild.gradle
with your porject name, license and developer information -
Update the
group
inbuild.gradle
to yourgroupId
(see step 1) -
Set the following environment variables on your local machine e.g. in
~/.bashrc
:
NEXUS_USER
: Your sonatype nexus username (see step 1)NEXUS_PASSWORD
: Your sonatype nexus password (see step 1)NEXUS_KEY_ID
: Your public key for signing artifactsNEXUS_KEY_PASSWORD
: The password you used to encrypt your public keyNEXUS_KEY_FILE
:~/.gnupg/secring.gpg
-
As a sanity check, confirm that your project builds successfully on your local machine
./gradlew clean build
-
Create a new repository in GitHub and point update the
origin
remotegit remote set-url origin git@github.com:<repository>/<my-new-project>
-
Add your new project in CircleCI and CodeClimate
- You may need to configure the default branch in CodeClimate to
develop
under Repo Settings.
-
Grab the Test Reporter Id from CodeClimate and update the value of
CC_TEST_REPORTER_ID
incircle.yml
-
To sign artifacts in circle, copy your base64-encoded secret key to your clipboard. For example, on Mac:
base64 -i ~/.gnupg/secring.gpg | pbcopy
-
Set the following environment variables in CircleCI:
NEXUS_USER
: (see step 6)NEXUS_PASSWORD
: (see step 6)NEXUS_KEY_ID
: (see step 6)NEXUS_KEY_PASSWORD
: (see step 6)NEXUS_KEY_FILE
:secring.gpg
(note this is not the same as the value you set in step 6)NEXUS_KEY_BASE64
: Your base64-encoded secret key (the output from step 11)
-
Commit and push your changes to
develop
git commit -am "initial commit initiated from https://github.com/clormor/personal-accounting" git push --set-upstream origin develop
Performing the first release
Releases are generated using the Gradle Sonatype Nexus plugin. See its documentation for guidance.
By default, this project is configured to publish releases to the release
branch. The first time you wish to perform a release, you may need to create the release
branch, if it does not already exist.
git branch release
You should now be able to perform a release by running ./gradlew release
and following the on-screen prompts.