{"id":24659266,"url":"https://github.com/brobert83/basic-java8-release","last_synced_at":"2026-04-17T15:02:50.138Z","repository":{"id":177259931,"uuid":"304966234","full_name":"brobert83/basic-java8-release","owner":"brobert83","description":"Basic release for java 8 package","archived":false,"fork":false,"pushed_at":"2020-10-18T23:40:23.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T02:54:18.627Z","etag":null,"topics":["java-8","maven-central","release-automation"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brobert83.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-17T20:45:19.000Z","updated_at":"2020-10-18T23:40:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"96de10ad-2e45-464e-886e-e9fea5768c34","html_url":"https://github.com/brobert83/basic-java8-release","commit_stats":null,"previous_names":["brobert83/basic-java8-release"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brobert83%2Fbasic-java8-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brobert83%2Fbasic-java8-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brobert83%2Fbasic-java8-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brobert83%2Fbasic-java8-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brobert83","download_url":"https://codeload.github.com/brobert83/basic-java8-release/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745754,"owners_count":20503050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java-8","maven-central","release-automation"],"created_at":"2025-01-26T02:54:19.513Z","updated_at":"2026-04-17T15:02:50.049Z","avatar_url":"https://github.com/brobert83.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic release tool for a Java 8 package including a push to Maven Central \n![Build and push to Dockerhub](https://github.com/brobert83/basic-java8-release/workflows/Build%20and%20push%20to%20Dockerhub/badge.svg)\n![Docker Image Size (tag)](https://img.shields.io/docker/image-size/robertbaboi/basic-java8-release/latest)\n![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)\n\nPublished here: https://hub.docker.com/r/robertbaboi/basic-java8-release\n\nThe purpose of this container is to perform a \"Release\" of a Java 8 package built with Maven and push it to Maven Central.\n\n| Env Variable            | Default value                     | Required | Comments                   \n|:-------------           |:--------------                    |:---------|------------------- \n| DEPLOY                  | yes                               |          | To skip `mvn deploy` just override this with anything other than `yes`\n| RELEASE_TYPE            | PATCH                             |          | Must be PATCH, MINOR or MAJOR (case insensitive)                     \n| GITHUB_REPO             |                                   |  YES     |                    \n| GITHUB_BRANCH           | master                            |          |                    \n| GITHUB_USERNAME         |                                   |  YES     |                    \n| GITHUB_EMAIL            |                                   |  YES     |                    \n| GITHUB_TOKEN_FILE       | /work/secrets/github_token        |          |                    \n| SIGNING_KEY_FILE        | /work/secrets/signingkey.asc      |          |                    \n| GPG_KEY_NAME_FILE       | /work/secrets/gpg_keyname         |          |                    \n| GPG_KEY_PASSPHRASE_FILE | /work/secrets/gpg_key_passphrase  |          |                    \n| SONATYPE_USERNAME_FILE  | /work/secrets/sonatype_username   |          |                    \n| SONATYPE_PASSWORD_FILE  | /work/secrets/sonatype_password   |          |                    \n\n## Example\n- The .m2 volume is mounted to avoid downloading the dependencies every time\n- All the secrets are mounted into `/work/secrets`\n\n```bash\ndocker run \\\n   -e GITHUB_REPO=github.com/${github_username}/${repo}.git \\\n   -e GITHUB_USERNAME=${github_username} \\\n   -e GITHUB_EMAIL=${github_email} \\\n   -v $(pwd)/../secrets:/work/secrets \\\n   -v $(pwd)/.m2:/root/.m2 \\\n  robertbaboi/basic-java8-release\n```\n\n# What does it do\n\n1. Checkout the branch\n2. Identify the release version(`${release_version}`) from `pom.xml` and calculate the next version(`${next_version}`) using the `RELEASE_TYPE` env var\n    - it uses a simplified semantic versioning system:\n        - the version **must match** this regular expression: `^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\-SNAPSHOT$`    \n    - The calculus will increase the version part to which the env var refers to\n        - For example, for version 2.5.1-SNAPSHOT, for all possible types, the next version will be:\n            - RELEASE_TYPE=PATCH: `2.5.2`   \n            - RELEASE_TYPE=MINOR: `2.6.0`\n            - RELEASE_TYPE=MAJOR: `3.0.0`\n3. Switch to a new branch named `RELEASE_${RELEASE_TYPE}_${release_version}`\n4. Change version to the `${release_version}`        \n5. Build\n6. Deploy\n    - runs:\n        ```bash\n        mvn clean deploy \\\n          -DskipTests=true \\\n          -Prelease \\\n          --settings /work/settings.xml \\\n          -Dgpg.executable=gpg2 \\\n          -Dgpg.keyname=${gpg_keyname} \\\n          -Dgpg.passphrase=${gpg_key_passphrase}\n        ```\n    - as long as pom.xml is properly configured this will push to Maven Central\n    - notice that this command activates the `release` profile\n7. Commit the version change\n8. Tags with `v${release_version}`          \n9. Updates the RELEASE_LOG.md file with a list of all commits in between this tag and the previous tag and commit\n   - **This is somewhat fragile because any other tags other than release tags will dirty this**\n10. Change the version to `${next_version}` and commit\n11. Push the release branch\n12. Push the tag\n\n# Source Project Maven configuration\n\n## SCM Section (replace the \u003c\u003c...\u003e\u003e placeholders)\n```xml\n\u003cscm\u003e\n    \u003cconnection\u003escm:git:https://github.com/\u003c\u003cusername\u003e\u003e/\u003c\u003crepo\u003e\u003e.git\u003c/connection\u003e\n    \u003cdeveloperConnection\u003escm:git:ssh://github.com/\u003c\u003cusername\u003e\u003e/\u003c\u003crepo\u003e\u003e.git\u003c/developerConnection\u003e\n    \u003curl\u003ehttps://github.com/\u003c\u003cusername\u003e\u003e/\u003c\u003crepo\u003e\u003e\u003c/url\u003e\n    \u003ctag\u003eHEAD\u003c/tag\u003e\n\u003c/scm\u003e\n```\n\n## Distribution Management Section\n```xml\n\u003cdistributionManagement\u003e\n   \u003csnapshotRepository\u003e\n       \u003cid\u003eossrh\u003c/id\u003e\n       \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n   \u003c/snapshotRepository\u003e\n   \u003crepository\u003e\n       \u003cid\u003eossrh\u003c/id\u003e\n       \u003curl\u003ehttps://oss.sonatype.org/service/local/staging/deploy/maven2\u003c/url\u003e\n   \u003c/repository\u003e\n\u003c/distributionManagement\u003e\n```\n\n## The `release` build profile\n```xml\n\u003cprofile\u003e     \n\n   \u003cid\u003erelease\u003c/id\u003e\n\n   \u003cbuild\u003e\n\n       \u003cplugins\u003e\n\n           \u003cplugin\u003e\n               \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n               \u003cartifactId\u003emaven-javadoc-plugin\u003c/artifactId\u003e\n               \u003cversion\u003e3.0.0\u003c/version\u003e\n               \u003cexecutions\u003e\n                   \u003cexecution\u003e\n                       \u003cid\u003eattach-javadocs\u003c/id\u003e\n                       \u003cgoals\u003e\n                           \u003cgoal\u003ejar\u003c/goal\u003e\n                       \u003c/goals\u003e\n                   \u003c/execution\u003e\n               \u003c/executions\u003e\n           \u003c/plugin\u003e\n\n           \u003cplugin\u003e\n               \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n               \u003cartifactId\u003emaven-source-plugin\u003c/artifactId\u003e\n               \u003cversion\u003e3.2.0\u003c/version\u003e\n               \u003cexecutions\u003e\n                   \u003cexecution\u003e\n                       \u003cid\u003eattach-sources\u003c/id\u003e\n                       \u003cgoals\u003e\n                           \u003cgoal\u003ejar\u003c/goal\u003e\n                       \u003c/goals\u003e\n                   \u003c/execution\u003e\n               \u003c/executions\u003e\n           \u003c/plugin\u003e\n\n           \u003cplugin\u003e\n               \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n               \u003cartifactId\u003emaven-gpg-plugin\u003c/artifactId\u003e\n               \u003cversion\u003e1.6\u003c/version\u003e\n               \u003cexecutions\u003e\n                   \u003cexecution\u003e\n                       \u003cid\u003esign-artifacts\u003c/id\u003e\n                       \u003cphase\u003everify\u003c/phase\u003e\n                       \u003cgoals\u003e\n                           \u003cgoal\u003esign\u003c/goal\u003e\n                       \u003c/goals\u003e\n                       \u003cconfiguration\u003e\n                           \u003cgpgArguments\u003e\n                               \u003carg\u003e--pinentry-mode\u003c/arg\u003e\n                               \u003carg\u003eloopback\u003c/arg\u003e\n                           \u003c/gpgArguments\u003e\n                       \u003c/configuration\u003e\n                   \u003c/execution\u003e\n               \u003c/executions\u003e\n           \u003c/plugin\u003e\n\n           \u003cplugin\u003e\n               \u003cgroupId\u003eorg.sonatype.plugins\u003c/groupId\u003e\n               \u003cartifactId\u003enexus-staging-maven-plugin\u003c/artifactId\u003e\n               \u003cversion\u003e1.6.8\u003c/version\u003e\n               \u003cextensions\u003etrue\u003c/extensions\u003e\n               \u003cconfiguration\u003e\n                   \u003cserverId\u003eossrh\u003c/serverId\u003e\n                   \u003cnexusUrl\u003ehttps://oss.sonatype.org/\u003c/nexusUrl\u003e\n                   \u003cautoReleaseAfterClose\u003etrue\u003c/autoReleaseAfterClose\u003e\n               \u003c/configuration\u003e\n           \u003c/plugin\u003e\n\n       \u003c/plugins\u003e\n\n   \u003c/build\u003e \n\n\u003c/profile\u003e\n```   \n   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrobert83%2Fbasic-java8-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrobert83%2Fbasic-java8-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrobert83%2Fbasic-java8-release/lists"}