{"id":15789959,"url":"https://github.com/nonblocking/nonsnapshot-maven-plugin","last_synced_at":"2026-03-18T01:34:38.801Z","repository":{"id":6980539,"uuid":"8235425","full_name":"nonblocking/nonsnapshot-maven-plugin","owner":"nonblocking","description":"Non-Snapshot Maven Plugin","archived":false,"fork":false,"pushed_at":"2023-11-03T14:24:45.000Z","size":170,"stargazers_count":10,"open_issues_count":4,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-05T22:04:17.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nonblocking.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2013-02-16T12:24:57.000Z","updated_at":"2023-11-03T14:24:49.000Z","dependencies_parsed_at":"2022-09-02T22:01:17.588Z","dependency_job_id":"14cde474-a4b5-4b49-bc7e-ece9f5bc1cfd","html_url":"https://github.com/nonblocking/nonsnapshot-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonblocking%2Fnonsnapshot-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonblocking%2Fnonsnapshot-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonblocking%2Fnonsnapshot-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonblocking%2Fnonsnapshot-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nonblocking","download_url":"https://codeload.github.com/nonblocking/nonsnapshot-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620447,"owners_count":20806776,"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":[],"created_at":"2024-10-04T22:04:20.218Z","updated_at":"2026-03-18T01:34:33.775Z","avatar_url":"https://github.com/nonblocking.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nonsnapshot Maven Plugin\n========================\n\nA Maven plugin to get rid of SNAPSHOT versions and automatically update artifact versions with each build if anything changes.\nSuch a change can be a scm commit since the last build or a newly available upstream dependency version within a configured range.\n\nMotivation\n----------\n\nWhen working on a huge project with hundreds of Maven artifacts depending on each other, \ndealing with SNAPSHOT versions really becomes unhandy. The main reasons are:\n\n1. The developers need to have all projects in the workspace to make sure the dependency resolution of the IDE works\n2. Manually versioning 100+ projects means a lot of effort\n3. It is not possible to reproduce the exact state of a project to any given time, when you depend on SNAPSHOT versions\n4. It makes a fully automatized deployment complicated, since you need a manual versioning step instead of just pushing the latest build onto your servers\n\nHow this plugin works\n---------------------\n\nThe algorithm works as follows:\n\n1. Collect all modules recursively.\n2. Check all modules for changes (commits) since the last version update. If commits exist mark the module as dirty.\n3. Resolve the latest upstream dependencies versions. If any newer version are available update the version accordingly\n    and mark the module as dirty.\n4. Mark all modules as dirty which have dirty dependencies.\n5. Bump the version of all dirty modules.\n6. Rewrite the pom.xml of all modules with a new version.\n7. Optional: Generate a script and/or property file for an incremental build of all dirty modules (Maven \u003e 3.2.1 required).\n8. Commit all changed pom.xml files to SCM. This step can be deferred and done by a second goal.\n\nThe generated artifact versions consist of a \"base version\", which can be configured,\nand the build timestamp or revision id (SVN only) as a qualifier. Examples:\n\n* 1.2.3-20141125\n* 1.2.3-123456\n\nConfiguration\n-------------\n\nThe plugin can be added to a separate (POM-) project or your main aggregator project. Like this:\n\n```xml\n\u003cbuild\u003e\n\t\u003cplugins\u003e\n\t\t\u003cplugin\u003e\n\t\t\t\u003cgroupId\u003eat.nonblocking\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003enonsnapshot-maven-plugin\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e4.0.1\u003c/version\u003e\n\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\u003cbaseVersion\u003e1.2.3\u003c/baseVersion\u003e\n\t\t\t\t\u003cscmType\u003eSVN\u003c/scmType\u003e\n\t\t\t\t\u003c!-- \u003cscmType\u003eGIT\u003c/scmType\u003e --\u003e\n\t\t\t\t\u003cscmUser\u003e${scmUser}\u003c/scmUser\u003e\n\t\t\t\t\u003cscmPassword\u003e${scmPassword}\u003c/scmPassword\u003e\n\t\t\t\t\u003cuseSvnRevisionQualifier\u003etrue\u003c/useSvnRevisionQualifier\u003e\n\t\t\t\t\u003cdeferPomCommit\u003etrue\u003c/deferPomCommit\u003e\n\t\t\t\t\u003cgenerateIncrementalBuildScripts\u003etrue\u003c/generateIncrementalBuildScripts\u003e\n\t\t\t\t\u003cgenerateChangedProjectsPropertyFile\u003etrue\u003c/generateChangedProjectsPropertyFile\u003e\n\t\t\t\t\u003cdontFailOnCommit\u003efalse\u003c/dontFailOnCommit\u003e\n\t\t\t\t\u003cdontFailOnUpstreamVersionResolution\u003efalse\u003c/dontFailOnUpstreamVersionResolution\u003e\n\t\t\t\t\u003cupstreamDependencies\u003e\n\t\t\t\t\t\u003cupstreamDependency\u003eat.nonblocking:*:LATEST\u003c/upstreamDependency\u003e\n\t\t\t\t\t\u003c!-- Examples --\u003e\n\t\t\t\t\t\u003c!-- \u003cupstreamDependency\u003eat.nonblocking:*:2.10\u003c/upstreamDependency\u003e --\u003e\n\t\t\t\t\t\u003c!-- \u003cupstreamDependency\u003eat.nonblocking:test-test2:2.10.3\u003c/upstreamDependency\u003e--\u003e\n\t\t\t\t\t\u003c!-- \u003cupstreamDependency\u003eat.nonblocking:test-*:LATEST\u003c/upstreamDependency\u003e--\u003e\n\t\t\t\t\u003c/upstreamDependencies\u003e\n\t\t\t\u003c/configuration\u003e\n\t\t\u003c/plugin\u003e\n\t\u003c/plugins\u003e\n\u003c/build\u003e\n\n```\n\n### Notes\n\n* Supported SCM systems are SVN and GIT, default is SVN.\n* By the default timestamps are used as qualifiers\n* *generateIncrementalBuildScripts* creates shell script for an incremental build using the new *--projects* option\n  to filter aggregate projects (Maven \u003e 3.2.1 only)\n* *generateChangedProjectsPropertyFile* creates a Java property file with a single entry which contains all changed projects.\n  This can be used in conjunction with the [EnvInject Plugin](https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin) on Jenkins to do an incremental build. Like this:\n  *mvn --project ${nonsnapshot.changed.projects} install*.\n* An upstream dependency is defined as *groupId:artifactId:baseVersion*. Whereas *groupId* and *artifactId* can contain\n   wildcards. The *baseVersion* is the \"prefix\" of allowed versions. Examples:\n    * 2.8 -\u003e Look for the latest version that starts with 2.8, e.g. 2.8.1-20140203\n    * 2.8.3 -\u003e Look for the latest version that starts with 2.8.3\n    * LATEST -\u003e Always look for the latest (non snapshot!) version\n* The upstream dependency list is processed in order of their definition and the first match is taken. That allows\n  it to define an exceptions from a wildcard rule like this:\n\n  ```xml\n  \t\u003cupstreamDependency\u003eat.nonblocking:test:2.3.4\u003c/upstreamDependency\u003e\n  \t\u003cupstreamDependency\u003eat.nonblocking:*:LATEST\u003c/upstreamDependency\u003e\n  ```\n\nUsage\n-----\n\n### Goals\n\nThe following goals are available:\n\n* *nonsnapshot:pretent*: Just shows how the versions would going to be changed. Does no actual POM rewrite or commit.\n* *nonsnapshot:updateVersions*: Rewrite all versions and commit. As soon the configuration parameter *deferPomCommit* is not set to true. In that case the commit is deferred.\n* *nonsnapshot:commitVersions*: Commits the POM files rewritten by the *updateVersions* goal. Makes only sense when *deferPomCommit\" is set to true.\n\n### Using it on a CI Server\n\nA fully automatized auto-release is of course only possible if you use this plugin within a CI server (e.g. *Jenkins*).\n\nFirst add the following optional configuration parameter:\n\n```xml\n\u003cdeferPomCommit\u003etrue\u003c/deferPomCommit\u003e\n```\n\nThen configure the job on your CI server like this:\n\n1. Revert and update the workspace\n2. Execute the goal *nonsnapshot:updateVersions*\n3. Build the whole project\n    * Option 1: *mvn install*\n    * Option 2: Incremental build with *mvn install --projects ${nonsnapshot.changed.projects}*.\n      To get the property *nonsnapshot.changed.projects* you have to enable the option *generateChangedProjectsPropertyFile*\n      and inject properties from the generated file *./nonsnapshotChangedProjects.properties*.\n      On Jenkins you can use the [EnvInject Plugin](https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin) for that.\n4. Deploy all generated artifacts to your remote Maven repository (e.g. *Artifactory*)\n5. Execute the goal *nonsnapshot:commitVersions*\n\nOn *Jenkins* you can use pre-build and post-build steps for #2 and #5.\n\nThis configuration guarantees that the module versions in the dependencies section of a POM file are always available from the remote Maven repository.\n(And so the developers no longer need all the Java projects in their workspace.)\n\n### Continuous Deployment\n\nFor Continuous Deployment just create a new release (POM-) module which includes\nall your deployment modules in the dependencies section.\n\nFor example:\n\n```xml\n\u003cdependencies\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003emy.domain\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ewebapp1\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e1.0.12-4567\u003c/version\u003e\n\t\t\t\u003ctype\u003ewar\u003c/type\u003e\n\t\t\u003c/dependency\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003emy.domain\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ewebapp2\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e1.0.12-4555\u003c/version\u003e\n\t\t\t\u003ctype\u003ewar\u003c/type\u003e\n\t\t\u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nSince the dependency versions are rewritten with each plugin execution, they will always point to the latest version.\nYou can now use the *maven-dependency-plugin* or the *maven-assembly-plugin* together with *ant* to copy all your deployment\nartifact to the server.\n\nLicence\n-------\n\nLicensed under the Apache License, Version 2.0.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonblocking%2Fnonsnapshot-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnonblocking%2Fnonsnapshot-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonblocking%2Fnonsnapshot-maven-plugin/lists"}