Please read the documentation on build profiles here: http://maven.apache.org/guides/introduction/introduction-to-profiles.html
You basically need to define a profile in your sub-module’s POM and include that plugin in the profile’s plugin
section. Using the plugin’s execution
tag, you can define which build phase the plugin should run in.
See here for an example: Using maven profiles to control build execution