{"id":20053211,"url":"https://github.com/romalev/maven-3-git-alpine-docker-image","last_synced_at":"2026-05-02T08:33:00.443Z","repository":{"id":127866449,"uuid":"192528511","full_name":"romalev/maven-3-git-alpine-docker-image","owner":"romalev","description":"Docker image that might be used by CI/CD servers to execute release of the project artifacts [by maven-release-plugin].","archived":false,"fork":false,"pushed_at":"2019-06-18T12:51:55.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-02T09:14:07.407Z","etag":null,"topics":["continuous-delivery","docker","git","maven","maven-release-plugin"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/romalev.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":"2019-06-18T11:39:55.000Z","updated_at":"2022-06-28T13:38:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c016035-b554-47b9-a14c-92d3ceca8430","html_url":"https://github.com/romalev/maven-3-git-alpine-docker-image","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/romalev/maven-3-git-alpine-docker-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romalev%2Fmaven-3-git-alpine-docker-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romalev%2Fmaven-3-git-alpine-docker-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romalev%2Fmaven-3-git-alpine-docker-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romalev%2Fmaven-3-git-alpine-docker-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romalev","download_url":"https://codeload.github.com/romalev/maven-3-git-alpine-docker-image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romalev%2Fmaven-3-git-alpine-docker-image/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32528223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["continuous-delivery","docker","git","maven","maven-release-plugin"],"created_at":"2024-11-13T12:23:34.605Z","updated_at":"2026-05-02T08:33:00.425Z","avatar_url":"https://github.com/romalev.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# maven-3-git-alpine-docker-image\nDocker image that might be used by CI/CD servers to execute the release of project artifacts [by maven-release-plugin].  \n\n*Motivation*\n-\nDevOps is a popular field nowadays where engineers spending lots of time automating\\enhancing continuous delivery process. Many CI/CD servers have \nbuilt-in capabilities to develop CD pipelines. For instance \u003cb\u003eJenkins\u003c/b\u003e has a concept of _Pipeline as code_ or defining the deployment pipeline through code \nrather than configuring a running CI/CD tool, provides tremendous benefits for teams automating infrastructure across their environments.      \n\n[\u003cb\u003eDocker\u003c/b\u003e](https://www.docker.com/) is very handy tool these days. CI/CD servers might spin up actual docker containers where CI/CD jobs take place.\n\nSay you were given to design\\implement CD pipeline for JVM based projects. Maven is a super popular build/automation tool - so why not to take advantage out of it ? \nThere is the [maven-release-plugin](https://maven.apache.org/maven-release/maven-release-plugin/) allowing you to release project with maven, saving a lot of repetitive, manual work.\n\nSo you want to: \n* utilize _maven-release-plugin_ \n* and run release job by Jenkins agent \n* where the entire pipeline, or a specific stage, will get executed within docker container. \n* how ? \n\n*How*\n-\nThere's already available docker image ```maven:3-alpine``` that you might use ... but it does NOT have \u003cb\u003egit\u003c/b\u003e installed which is required \nby _maven-release-plugin_. \nIn order to let _maven-release-plugin_ push changes to your Git server you have to connect your docker container runtime with Git server. This can be done via [SSH](https://help.github.com/en/articles/connecting-to-github-with-ssh):\n* deploy your public key to GIT server.\n* normally private key will be available under ```~/.ssh/id_rsa```\n* build docker image ```docker build -t git-maven:3-alpine -f Dockerfile .``` Make sure private key was added to ```/root/.ssh/id_rsa``` \n\nNow your newly built docker image is ready to release projects via _maven-release-plugin_. \nAppropriate Jenkins Pipeline might look like :\n\n```\npipeline {\n    agent {\n        docker {\n            image 'git-maven:3-alpine'\n            args '-v /root/.m2:/root/.m2 --network=host'\n        }\n    }\n    \n    parameters {\n        string defaultValue: '', description: 'Release Version.', name: 'releaseVersion', trim: true\n        string defaultValue: '', description: 'Next Devevelopment Version.', name: 'developmentVersion', trim: true\n    }\n    stages {\n        stage('Checkout') {\n            steps {\n               checkout([$class: 'GitSCM', \n\t\t\t\t\t\tbranches: [[name: 'origin/master']], \n\t\t\t\t\t\tdoGenerateSubmoduleConfigurations: false,  extensions: [[$class: 'LocalBranch', localBranch: 'master']], \n\t\t\t\t\t\tsubmoduleCfg: [], \n\t\t\t\t\t\tuserRemoteConfigs: [[credentialsId: 'yourCredsId', url: 'https://github.com/[username]/[project]']]])\n            }\n        }\n        stage('Release') {\n            steps {\n                sh 'mvn release:clean release:prepare release:perform -DreleaseVersion=${releaseVersion} -DdevelopmentVersion=${developmentVersion}'\n            }\n        }\n    }\n}\n\n```\n\nVoilà! \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromalev%2Fmaven-3-git-alpine-docker-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromalev%2Fmaven-3-git-alpine-docker-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromalev%2Fmaven-3-git-alpine-docker-image/lists"}