You can parameterize them using maven properties , override them after inheriting . In your case, you can enter the mainClass property and use it in your plugin configuration from the parent module, for example, <mainClass>${mainClass}</mainClass> . These properties can then be overridden in child modules.
EDIT:
For the parent pom, I meant the pluginManagement section (Sorry for the fuzziness). I created an example with your build configuration here: https://gist.github.com/ceilfors/5827916
I think the minimum you can get in a child module. maven-jar-plugin is optional due to the type of packaging in the jar. Refer to the lifecycle bindings and you can see that the plugin will be called during the package phase.
In addition, when your project becomes more complex, you can learn how to integrate the plugin configuration. I created another example here: https://gist.github.com/ceilfors/5828039 . Note that the properties for mainClass were not used.
Hope this helps.
source share