{"id":37021891,"url":"https://github.com/c0d3d/plugin-repeater-maven-plugin","last_synced_at":"2026-01-14T02:36:21.539Z","repository":{"id":23653374,"uuid":"99514009","full_name":"c0d3d/plugin-repeater-maven-plugin","owner":"c0d3d","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-22T19:13:16.000Z","size":72,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-02T15:25:41.062Z","etag":null,"topics":["dry","macro","maven","plugin","template","xml"],"latest_commit_sha":null,"homepage":null,"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/c0d3d.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}},"created_at":"2017-08-06T21:22:05.000Z","updated_at":"2022-05-23T14:45:25.000Z","dependencies_parsed_at":"2022-09-18T20:21:44.954Z","dependency_job_id":null,"html_url":"https://github.com/c0d3d/plugin-repeater-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/c0d3d/plugin-repeater-maven-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0d3d%2Fplugin-repeater-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0d3d%2Fplugin-repeater-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0d3d%2Fplugin-repeater-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0d3d%2Fplugin-repeater-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c0d3d","download_url":"https://codeload.github.com/c0d3d/plugin-repeater-maven-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0d3d%2Fplugin-repeater-maven-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["dry","macro","maven","plugin","template","xml"],"created_at":"2026-01-14T02:36:20.842Z","updated_at":"2026-01-14T02:36:21.532Z","avatar_url":"https://github.com/c0d3d.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plugin repeater maven plugin [![Build Status](https://travis-ci.org/c0d3d/plugin-repeater-maven-plugin.svg?branch=master)](https://travis-ci.org/c0d3d/plugin-repeater-maven-plugin) [![Maven Central](https://img.shields.io/maven-central/v/com.nlocketz.plugins/plugin-repeater-maven-plugin.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.nlocketz.plugins%22%20a%3A%22plugin-repeater-maven-plugin%22)\n\nTable of contents\n=================\n\n  * [Summary](#summary)\n  * [Simple Example](#simple-example)\n  * [Default Variable Groups](#default-variable-groups)\n  * [Conditional Inclusion](#conditional-xml-inclusion)\n\n## Summary\nThe plugin repeater maven plugin allows you to follow the [DRY principal](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) when writing your POM files.\n\nIf you've ever had to write a very similar plugin execution dozens of times then this is the plugin for you.\n\nThe plugin repeater plugin lets you repeat a plugin execution with different variables substituted.\n\nAll the examples in this README assume that we have a fictional plugin, `adder-maven-plugin`, that adds numbers. Anywhere you see `\u003c!-- Boilerplate omitted --\u003e`\nmeans that we've left out the plugin GAV as well as any tags that aren't necessary. This may mean it is in the `contentPlugin` section of a repeater plugin\nconfiguration or a plugin inside a pom's `plugins` section. The context should provide that information for you.\n\n## Simple Example\n\nSay we wanted to add 5 sets of two numbers. Normally you'd have to write something like this:\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003efake.plugin.group\u003c/groupId\u003e\n        \u003cartifactId\u003eadder-maven-plugin\u003c/artifactId\u003e\n        \u003cversion\u003e0.0.0\u003c/version\u003e\n        \u003cexecutions\u003e\n            \u003cexecution\u003e\n                \u003cid\u003efirst-number-add\u003c/id\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eadd\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003cnumberOne\u003e1\u003c/numberOne\u003e\n                    \u003cnumberTwo\u003e2\u003c/numberTwo\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n            \u003cexecution\u003e\n                \u003cid\u003esecond-number-add\u003c/id\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eadd\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003cnumberOne\u003e3\u003c/numberOne\u003e\n                    \u003cnumberTwo\u003e4\u003c/numberTwo\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n            \u003cexecution\u003e\n                \u003cid\u003ethird-number-add\u003c/id\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eadd\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003cnumberOne\u003e5\u003c/numberOne\u003e\n                    \u003cnumberTwo\u003e6\u003c/numberTwo\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n            \u003cexecution\u003e\n                \u003cid\u003efour-number-add\u003c/id\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eadd\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003cnumberOne\u003e7\u003c/numberOne\u003e\n                    \u003cnumberTwo\u003e8\u003c/numberTwo\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n            \u003cexecution\u003e\n                \u003cid\u003efifth-number-add\u003c/id\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eadd\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003cnumberOne\u003e9\u003c/numberOne\u003e\n                    \u003cnumberTwo\u003e10\u003c/numberTwo\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n        \u003c/executions\u003e\n    \u003c/plugin\u003e\n\nWith the plugin repeater maven plugin you can just write:\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003ecom.nlocketz.plugins\u003c/groupId\u003e\n        \u003cartifactId\u003eplugin-repeater-maven-plugin\u003c/artifactId\u003e\n        \u003c!-- Check maven central for latest version --\u003e\n        \u003cversion\u003eLATEST\u003c/version\u003e\n        \u003cexecutions\u003e\n            \u003cexecution\u003e\n                \u003cid\u003erun-addings\u003c/id\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003erepeat\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003crepetitions\u003e\n                        \u003c!-- Each repetition corresponds to a single run of contentPlugin --\u003e\n                        \u003c!-- The values mapped in the repetition are subbed in @ surrounded tags --\u003e\n                        \u003crepetition\u003e\n                            \u003cnOne\u003e1\u003c/nOne\u003e\n                            \u003cnTwo\u003e2\u003c/nTwo\u003e\n                        \u003c/repetition\u003e\n                        \u003crepetition\u003e\n                            \u003cnOne\u003e3\u003c/nOne\u003e\n                            \u003cnTwo\u003e4\u003c/nTwo\u003e\n                        \u003c/repetition\u003e\n                        \u003crepetition\u003e\n                            \u003cnOne\u003e5\u003c/nOne\u003e\n                            \u003cnTwo\u003e6\u003c/nTwo\u003e\n                        \u003c/repetition\u003e\n                        \u003crepetition\u003e\n                            \u003cnOne\u003e7\u003c/nOne\u003e\n                            \u003cnTwo\u003e8\u003c/nTwo\u003e\n                        \u003c/repetition\u003e\n                        \u003crepetition\u003e\n                            \u003cnOne\u003e9\u003c/nOne\u003e\n                            \u003cnTwo\u003e10\u003c/nTwo\u003e\n                        \u003c/repetition\u003e\n                    \u003c/repetitions\u003e\n                    \u003ccontentPlugin\u003e\n                        \u003cgroupId\u003efake.plugin.group\u003c/groupId\u003e\n                        \u003cartifactId\u003eadder-maven-plugin\u003c/artifactId\u003e\n                        \u003cversion\u003e0.0.0\u003c/version\u003e\n                        \u003cexecutions\u003e\n                            \u003cexecution\u003e\n                                \u003cid\u003erepeat-add\u003c/id\u003e\n                                \u003cgoals\u003e\n                                    \u003c!-- Every goal will be run. --\u003e\n                                    \u003c!-- the adder-maven-plugin only has one goal --\u003e\n                                    \u003cgoal\u003eadd\u003c/goal\u003e\n                                \u003c/goals\u003e\n                                \u003c!-- NOTE: Due to a limitation of the maven plugin API --\u003e\n                                \u003c!-- this doesn't support the phase tag. All the executions --\u003e\n                                \u003c!-- are run in the same phase as your plugin-repeator-maven-plugin --\u003e\n                                \u003cconfiguration\u003e\n                                    \u003c!-- These @ surrounded variables are replaced with their --\u003e\n                                    \u003c!-- corresponding values during each repetition. --\u003e\n                                    \u003cnumberOne\u003e@nOne@\u003c/numberOne\u003e\n                                    \u003cnumberTwo\u003e@nTwo@\u003c/numberTwo\u003e\n                                \u003c/configuration\u003e\n                            \u003c/execution\u003e\n                        \u003c/executions\u003e\n                    \u003c/contentPlugin\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n        \u003c/executions\u003e\n    \u003c/plugin\u003e\n\n## Default Variable Groups\n\nIf you have some repetitions that all use a certain variable with a certain value, except 1, you'd have to repeat that variable in the repetitions (violating the DRY principal).\nFear not! We have thought of this, and added a feature called `repetitionGroup`s that allow you to set defaults for certain repetitions, and override it for others.\n\nHere is an example:\n\n    \u003c!-- Boilerplate omitted --\u003e\n    \u003cexecution\u003e\n        \u003cid\u003erun-addings\u003c/id\u003e\n        \u003cgoals\u003e\n            \u003cgoal\u003erepeat\u003c/goal\u003e\n        \u003c/goals\u003e\n        \u003cconfiguration\u003e\n            \u003crepetitions\u003e\n                \u003crepetitionGroup\u003e\n                    \u003c!-- Here we set a default for 'nOne'. --\u003e\n                    \u003c!-- If any repetitions nested inside this repetitionGroup --\u003e\n                    \u003c!-- *don't* declare 'nOne', it will be supplied by the most recent default. --\u003e\n                    \u003c!-- In this case that is the top level repetition group, and 2. --\u003e\n                    \u003cnOne\u003e2\u003c/nOne\u003e\n                    \u003crepetition\u003e\n                        \u003cnTwo\u003e2\u003c/nTwo\u003e\n                    \u003c/repetition\u003e\n                    \u003crepetition\u003e\n                        \u003cnTwo\u003e3\u003c/nTwo\u003e\n                    \u003c/repetition\u003e\n                    \u003crepetition\u003e\n                        \u003cnTwo\u003e4\u003c/nTwo\u003e\n                        \u003cnOne\u003e4\u003c/nOne\u003e\n                    \u003c/repetition\u003e\n                \u003c/repetitionGroup\u003e\n            \u003c/repetitions\u003e\n            ...\n            \u003c!-- Same as before ... --\u003e\n            ...\n        \u003c/configuration\u003e\n    \u003c/execution\u003e\n\nwhich is equivalent to:\n\n    \u003c!-- Boilerplate omitted --\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003c!-- NOTE: even though these have the same execution ID --\u003e\n            \u003c!-- they will all be run inside the plugin-repeater-maven-plugin --\u003e\n            \u003cid\u003erepeat-add\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eadd\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cnumberOne\u003e2\u003c/numberOne\u003e\n                \u003cnumberTwo\u003e2\u003c/numberTwo\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n            \u003cid\u003erepeat-add\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eadd\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cnumberOne\u003e2\u003c/numberOne\u003e\n                \u003cnumberTwo\u003e3\u003c/numberTwo\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n            \u003cid\u003erepeat-add\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eadd\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cnumberOne\u003e4\u003c/numberOne\u003e\n                \u003cnumberTwo\u003e4\u003c/numberTwo\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\nYou can even nest these as deeply as you want!\n\n    \u003c!-- Boilerplate omitted --\u003e\n    \u003cexecution\u003e\n        \u003cid\u003erun-addings\u003c/id\u003e\n        \u003cgoals\u003e\n            \u003cgoal\u003erepeat\u003c/goal\u003e\n        \u003c/goals\u003e\n        \u003cconfiguration\u003e\n            \u003crepetitions\u003e\n                \u003crepetitionGroup\u003e\n                    \u003cnOne\u003e2\u003c/nOne\u003e\n                    \u003crepetitionGroup\u003e\n                        \u003cnTwo\u003e2\u003c/nTwo\u003e\n                        \u003crepetition\u003e\n                            \u003cnOne\u003e10\u003c/nOne\u003e\n                        \u003c/repetition\u003e\n                    \u003c/repetitionGroup\u003e\n                    \u003crepetition\u003e\n                        \u003cnTwo\u003e-1\u003c/nTwo\u003e\n                    \u003c/repetition\u003e\n                \u003c/repetitionGroup\u003e\n            \u003c/repetitions\u003e\n            ...\n            \u003c!-- Same as before ... --\u003e\n            ...\n        \u003c/configuration\u003e\n    \u003c/execution\u003e\n\nis equivalent to:\n\n    \u003c!-- Boilerplate omitted --\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003erepeat-add\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eadd\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cnumberOne\u003e10\u003c/numberOne\u003e\n                \u003cnumberTwo\u003e2\u003c/numberTwo\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n            \u003cid\u003erepeat-add\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eadd\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cnumberOne\u003e2\u003c/numberOne\u003e\n                \u003cnumberTwo\u003e-1\u003c/numberTwo\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003cexecutions\u003e\n\n##### Small gotcha\n\nDue to limitations on maven's XML, you cannot currently do something like this:\n\n    \u003c!-- Boilerplate omitted --\u003e\n    \u003cexecution\u003e\n        \u003cid\u003erun-addings\u003c/id\u003e\n        \u003cgoals\u003e\n            \u003cgoal\u003erepeat\u003c/goal\u003e\n        \u003c/goals\u003e\n        \u003cconfiguration\u003e\n            \u003crepetitions\u003e\n                \u003crepetitionGroup\u003e\n                    \u003cnOne\u003e2\u003c/nOne\u003e\n                    \u003crepetitionGroup\u003e\n                        \u003cnTwo\u003e2\u003c/nTwo\u003e\n                        \u003c!-- neither of the following tags will be recognized! --\u003e\n                        \u003c!-- Even though they are unambiguous in terms of their intention --\u003e\n                        \u003crepetition/\u003e\n                        \u003crepetition\u003e\n                        \u003c/repetition\u003e\n                    \u003c/repetitionGroup\u003e\n                \u003c/repetitionGroup\u003e\n            \u003c/repetitions\u003e\n            ...\n            \u003c!-- Same as before ... --\u003e\n            ...\n        \u003c/configuration\u003e\n    \u003c/execution\u003e\n\n## Conditional XML Inclusion\n\nThe plugin-repeater-maven-plugin also supports conditional inclusion of XML for content plugins.\nCurrently you can only make the decision based on whether a filter variable is defined for the current repetition or not.\n\nIn order to conditionally include a tag, `myTag` inside the configuration of your content plugin you can do the following:\n\n    \u003cconfiguration\u003e\n        \u003cmyTag if=\"myVar\"\u003e@myVar@\u003c/myTag\u003e\n    \u003c/configuration\u003e\n\nThis includes `\u003cmyTag\u003emyVarValue\u003c/myTag\u003e` if `myVar` has a definition for the current repetition.\nAn important note for this is that a failed condition excludes *everything* within the failing tag.\nAny nested XML tags will also be excluded as well as any attributes or string contents.\n\nThe plugin-repeater-maven-plugin also supports the `unless` attribute.\n\nHere is a toy usage:\n\n    \u003c!-- Boilerplate omitted --\u003e\n    \u003cexecution\u003e\n        \u003cid\u003erun-addings\u003c/id\u003e\n        \u003cgoals\u003e\n            \u003cgoal\u003erepeat\u003c/goal\u003e\n        \u003c/goals\u003e\n        \u003cconfiguration\u003e\n            \u003crepetitions\u003e\n                \u003crepetition\u003e\n                    \u003cnOne\u003e1\u003c/nOne\u003e\n                    \u003cnTwo\u003e2\u003c/nTwo\u003e\n                \u003c/repetition\u003e\n                \u003crepetition\u003e\n                    \u003cnTwo\u003e5\u003c/nTwo\u003e\n                \u003c/repetition\u003e\n            \u003c/repetitions\u003e\n            \u003ccontentPlugin\u003e\n                \u003cgroupId\u003efake.plugin.group\u003c/groupId\u003e\n                \u003cartifactId\u003eadder-maven-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e0.0.0\u003c/version\u003e\n                \u003cexecutions\u003e\n                    \u003cexecution\u003e\n                        \u003cid\u003erepeat-add\u003c/id\u003e\n                        \u003cgoals\u003e\n                            \u003cgoal\u003eadd\u003c/goal\u003e\n                        \u003c/goals\u003e\n                        \u003cconfiguration\u003e\n                            \u003cnumberOne if=\"nOne\"\u003e@nOne@\u003c/numberOne\u003e\n                            \u003cnumberOne unless=\"nOne\"\u003e0\u003c/numberOne\u003e\n                            \u003cnumberTwo\u003e@nTwo@\u003c/numberTwo\u003e\n                        \u003c/configuration\u003e\n                    \u003c/execution\u003e\n                \u003c/executions\u003e\n            \u003c/contentPlugin\u003e\n        \u003c/execution\u003e\n\t\u003c/executions\u003e\n\nwhich equivalent to:\n\n    \u003c!-- Boilerplate omitted --\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003erepeat-add\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eadd\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cnumberOne\u003e1\u003c/numberOne\u003e\n                \u003cnumberTwo\u003e2\u003c/numberTwo\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n            \u003cid\u003erepeat-add\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eadd\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cnumberOne\u003e0\u003c/numberOne\u003e\n                \u003cnumberTwo\u003e5\u003c/numberTwo\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003cexecutions\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc0d3d%2Fplugin-repeater-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc0d3d%2Fplugin-repeater-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc0d3d%2Fplugin-repeater-maven-plugin/lists"}