ams
ams

Reputation: 62652

How to force manual execution of a maven plugin?

Is there a way in maven to force a plugin to only execute manually. for example I have the sql plugin which will be creating some tables, I don't want this plugin to run all the time with every build i want it only run when I tell maven to run that plugin. How can a plugin be configured to run manually?

Upvotes: 4

Views: 3426

Answers (1)

Duncan Jones
Duncan Jones

Reputation: 69339

Most plugins won't execute automatically unless they are bound to a build phase. You should find that your plugin won't execute unless you specify it on the command line: mvn plugin:goal.

If the plugin is already bound automatically to a phase, you can undo this by binding it to a non-existent phase (none is the traditional choice). See this question for an example of this.

Upvotes: 9

Related Questions