{"id":17822087,"url":"https://github.com/fo0/java-gh-package-registry-example","last_synced_at":"2026-05-04T10:40:26.056Z","repository":{"id":91945869,"uuid":"292692655","full_name":"fo0/java-gh-package-registry-example","owner":"fo0","description":"guide for creating a library including package-registry deployment","archived":false,"fork":false,"pushed_at":"2020-10-17T13:18:44.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T01:42:58.649Z","etag":null,"topics":["github","github-actions","guide","java","library","maven","package-registry"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fo0.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-09-03T22:25:33.000Z","updated_at":"2020-10-17T13:18:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"c83306f7-abbd-4090-99ea-7298bc98a532","html_url":"https://github.com/fo0/java-gh-package-registry-example","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fo0%2Fjava-gh-package-registry-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fo0%2Fjava-gh-package-registry-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fo0%2Fjava-gh-package-registry-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fo0%2Fjava-gh-package-registry-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fo0","download_url":"https://codeload.github.com/fo0/java-gh-package-registry-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246802315,"owners_count":20836363,"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":["github","github-actions","guide","java","library","maven","package-registry"],"created_at":"2024-10-27T17:35:13.946Z","updated_at":"2026-05-04T10:40:26.024Z","avatar_url":"https://github.com/fo0.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Publish package to GitHub Packages](https://github.com/fo0/java-gh-package-registry-example/workflows/Publish%20package%20to%20GitHub%20Packages/badge.svg)\n\n# How to publish your written library inside your github repository to your personal github package registry?\n\n### first of all there are some requirements for this guide\n- you need a github account\n- your code must be inside the repository\n- your code must compile\n- every push consumes 1 github action\n- this guide is for java-8 but you can do this for java-x too\n- you must be the repository owner\n- you need a [github access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)\n- you must now how to add a [secret to github](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)\n- you want maven for your dependency management\n\n### what is my configuration?\n- 1 [action for deploy](https://github.com/fo0/java-gh-package-registry-example/blob/master/.github/workflows/maven_deploy.yml)\n- deploy action listening for new [tags](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-tags) [eclipse-create-tags](https://wiki.eclipse.org/EGit/User_Guide#Creating_a_Tag)\n- java-8\n- maven\n- status badge\n\n\n# Let's start!\nThis examples has all includings links and examples for the own repository, please modify the links for your own\n\n1. Open your pom.xml and add the following distributedManagement if its not already inside your [pom.xml](https://github.com/fo0/java-gh-package-registry-example/blob/master/hello-world-example/pom.xml)\n```xml\n\t\u003cdistributionManagement\u003e\n\t\t\u003crepository\u003e\n\t\t\t\u003cid\u003egithub\u003c/id\u003e\n\t\t\t\u003cname\u003eGitHub Packages\u003c/name\u003e\n      \u003c!-- https://maven.pkg.github.com/\u003cgithub-user\u003e/\u003crepository\u003e --\u003e\n\t\t\t\u003curl\u003ehttps://maven.pkg.github.com/fo0/java-gh-package-registry-example\u003c/url\u003e\n\t\t\u003c/repository\u003e\n\t\u003c/distributionManagement\u003e\n```\n2. go to your [github actions](https://github.com/fo0/hello-world-java-lib/actions)\n3. create your action for deploy [workflow](https://github.com/fo0/hello-world-java-lib/blob/master/.github/workflows/maven_deploy.yml)\n  - line 7: listening for new created releases\n  - line 15: java-version\n  - line 17: path to your \u003cpom.file\u003e\n  - line 19: name of your github-secret for your github-token\n  \n4. commit something\n5. create a new tag i.e. v0.1\n6. check the [github actions](https://github.com/fo0/hello-world-java-lib/actions) there should be one new tasks. Starting with deploy.\n7. open [package-registry](https://github.com/fo0/hello-world-java-lib/packages) after first task deploy is finished\n8. [creating a badge](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository)\n\n# How to access the library now?\nThere are two ways to access the library\n- via github\n- TODO: via maven central (including a new action)\n\n0. create or open the maven .settings.xml and add your github account informations to access the github package-registry (currently its a limitation of github)\n```\n\u003cservers\u003e\n    \u003cserver\u003e\n        \u003cid\u003egithub\u003c/id\u003e\n        \u003cusername\u003eYOUR_USERNAME\u003c/username\u003e\n        \u003cpassword\u003eYOUR_AUTH_TOKEN\u003c/password\u003e\n    \u003c/server\u003e\n\u003c/servers\u003e\n```\n1. open your java-project where you want to use the new library\n2. navigate to the pom.xml\n3. add your library dependency, you can copy it from your github [package-registry](https://github.com/fo0/hello-world-java-lib/packages)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffo0%2Fjava-gh-package-registry-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffo0%2Fjava-gh-package-registry-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffo0%2Fjava-gh-package-registry-example/lists"}