how can I define the antrun plugin to be executed on demand like “mvn antrun:run”?
This isn’t actually possible with the plugin, unless perhaps you do this: • put everything in a top level configuration of the plugin • pass in a variable from the command line, eg -Dtarget=foo antrun:run • execute the appropriate target in the script based on the variable Ideally, you would write a plugin for these goals (Ant support for plugins will be available soon, currently you must write them in java or beanshell).