{"id":15334615,"url":"https://github.com/chonton/exists-maven-plugin","last_synced_at":"2025-04-06T06:13:59.434Z","repository":{"id":10608175,"uuid":"66336409","full_name":"chonton/exists-maven-plugin","owner":"chonton","description":"Check if artifact exists in remote maven repository","archived":false,"fork":false,"pushed_at":"2024-11-07T16:28:54.000Z","size":706,"stargazers_count":50,"open_issues_count":10,"forks_count":18,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T05:09:03.750Z","etag":null,"topics":["exists","maven-plugin","up-for-adoption"],"latest_commit_sha":null,"homepage":"","language":"Java","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/chonton.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":"2016-08-23T05:37:36.000Z","updated_at":"2024-12-24T15:05:27.000Z","dependencies_parsed_at":"2023-11-20T22:28:22.628Z","dependency_job_id":"5480eff2-7529-4243-8bae-2101e3e2dc47","html_url":"https://github.com/chonton/exists-maven-plugin","commit_stats":{"total_commits":63,"total_committers":14,"mean_commits":4.5,"dds":0.5714285714285714,"last_synced_commit":"73b4da1856afd6e65bb591ecd17d8b18eaee3d04"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chonton%2Fexists-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chonton%2Fexists-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chonton%2Fexists-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chonton%2Fexists-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chonton","download_url":"https://codeload.github.com/chonton/exists-maven-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441063,"owners_count":20939239,"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":["exists","maven-plugin","up-for-adoption"],"created_at":"2024-10-01T10:08:11.716Z","updated_at":"2025-04-06T06:13:59.415Z","avatar_url":"https://github.com/chonton.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# exists-maven-plugin\n\nCheck if a maven artifact exists. Designed around the use case of skipping deployment if the stable\nversion already exists.\n\n## How This Plugin Determines if Builds are the \"Same\"\nThere are two strategies to determine if a maven artifacts are the \"same\" as what the project just\nbuilt: version comparison, and checksum comparison.  By default, this plugin uses version comparison.\nVersion comparison simply checks if the group:artifact:version matches an artifact in the local or\nremote repository.  This simple check will not catch the situation where the developer has failed to\nupdate the version in pom.xml.\n\nAlternatively, when `\u003ccmpChecksum\u003e` is true, this plugin compares the checksum of the local or remote\nartifact with the just built artifact.  Checksum comparison requires that the maven build be\nreproducible.  Without specific configuration, maven builds are **not** reproducible.  See\n[Configuring for Reproducible Builds](https://maven.apache.org/guides/mini/guide-reproducible-builds.html)\nfor details on making your build reproducible.\n\n## Goals\n\nThere are two goals: [local](https://chonton.github.io/exists-maven-plugin/local-mojo.html)\nchecks if the just built artifact is already in the local repository;\nand [remote](https://chonton.github.io/exists-maven-plugin/remote-mojo.html) checks if the\njust built artifact is already in the remote repository.\n\nMojo details at [plugin info](https://chonton.github.io/exists-maven-plugin/plugin-info.html)\n\n## Parameters\n\nEvery parameter can be set with a maven property **exists.**_\u003cparameter_name\\\u003e_. e.g. skip parameter\ncan be set from command line -Dexists.skip=true.\n\nIn the following table `p:` indicates the default constituent properties are prefixed with\n`project.` and `dm:` indicates the default constituent properties are prefixed with\n`project.distributionManagement.` e.g. for artifact parameter, the full default is\n`${project.artifactId}-${project.version}.${project.packaging}`\n\n| Parameter           | Default                                             | Description                                                                             |\n|---------------------|-----------------------------------------------------|-----------------------------------------------------------------------------------------|\n| artifact            | p: ${artifactId}-${version}.${packaging}            | The artifact within the project to query                                                |\n| cmpChecksum         | false                                               | Compare checksums of artifacts                                                          |\n| failIfExists        | false                                               | Fail the build if the artifact already exists                                           |\n| failIfNotExists     | false                                               | Fail the build if the artifact does not exist                                           |\n| failIfNotMatch      | false                                               | Fail the build if the artifact exists and cmpChecksum is set and checksums do not match |\n| lastSnapshotTime    |                                                     | The property to set with the timestamp of the last snapshot install / deploy            |\n| project             | p: ${groupId}:${artifactId}:${packaging}:${version} | The project within the repository to query                                              |\n| classifier          |                                                     | The classifier to use for checking the repository, e.g. 'tests'                         |\n| property            | ${maven.deploy.skip} _or_ ${maven.install.skip}     | The property to receive the result of the query                                         |\n| repository          | dm: ${repository.url}                               | For remote goal, the repository to query for artifacts                                  |\n| requireGoal         |                                                     | Execute goal only if requireGoal value matches one of the maven command line goals      |\n| serverId            | dm: ${repository.id}                                | For remote goal, the server ID to use for authentication and proxy settings             |\n| skip                | false                                               | Skip executing the plugin                                                               |\n| skipIfSnapshot      | true                                                | Skip the query if the project ends with -SNAPSHOT                                       |\n| snapshotRepository  | dm: ${snapshotRepository.url}                       | For remote goal, the repository to query for snapshot artifacts                         |\n| snapshotServerId    | dm: ${snapshotRepository.id}                        | For remote goal, the server ID to use for snapshot authentication and proxy settings    |\n| userProperty        | false                                               | If the property should be set as a user property, to be available in child projects     |\n\n## Requirements\n\n- Maven 3.8.1 or later\n- Java 11 or later\n\n## Typical Use\n\n```xml\n\n\u003cbuild\u003e\n  \u003cplugins\u003e\n\n    \u003cplugin\u003e\n      \u003cgroupId\u003eorg.honton.chas\u003c/groupId\u003e\n      \u003cartifactId\u003eexists-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e0.14.0\u003c/version\u003e\n      \u003cexecutions\u003e\n        \u003cexecution\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003eremote\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n\n  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n## Snapshot builds\n\nWhen checking snapshot builds against a remote/local repository, the last deployed/installed\nsnapshot of the correct version will be matched. Optionally, you can configure a property with\nthe `lastSnapshotTime` parameter which will receive the build timestamp. If you need additional date\nmath on the timestamp value, open a feature request with your use case.\n\n## Preventing failures of `remote` goal\n\nConsider the scenario where there is an artifact that can only be deployed from a specific build\nserver to a corporate repository with a specialized workflow that ensures various security and\nlicense policies. The exists-maven-plugin remote goal is also used to avoid duplicate deployments.\n\nRunning maven with the `install` phase will cause the exists-maven-plugin to execute the `remote`\ntask. This might fail for various reasons; including the developer laptop is not connected to the\ninternet, or the corporate repository is only available to specific build machines.\n\nWe could change the binding of the `remote` goal to the `deploy` phase. However, the\nmaven-deploy-plugin's `deploy` goal will run before exists-maven-plugin's `remote` goal because\n[\"When multiple executions are given that match a particular phase, they are executed in the order\nspecified in the POM, with inherited executions running first.\"](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#plugins)\n\nThe solution is to leave the `remote` goal bound to the `install` phase and add a `requireGoal`\nconfiguration:\n\n```xml\n\n\u003cconfiguration\u003e\n  \u003c!-- run only if deploy goal is specified in maven command line --\u003e\n  \u003crequireGoal\u003edeploy\u003c/requireGoal\u003e\n\u003c/configuration\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchonton%2Fexists-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchonton%2Fexists-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchonton%2Fexists-maven-plugin/lists"}