1

I have a multi-module maven project with a reactor pom that I use to build the whole project, and a parent pom which all child modules inherit from.

There is a plugin I need to have in both the reactor and the parent poms, meaning I have a separate use for the plugin in the child modules and in the reactor pom used to aggregate the build. I'd like to manage the version of this plugin in one file, instead of manually changing it in both files every time.

Example:

Project structure:
--pom.xml //reactor pom - aggregates the build (contains the plugin)
----parent/pom.xml //parent pom - all child modules inherit this pom (contains the plugin)
----a/pom.xml //module a - inherits parent/pom.xml
----b/pom.xml //module b - inherits parent/pom.xml
----c/pom.xml //module c - inherits parent/pom.xml

Note: the parent pom is inherited by child modules only. Not by the reactor.

any help is greatly appreciated, thanks in advance

Eddie
  • 73
  • 1
  • 4
  • 1
    Define the version and the plugin itself via pluginManagement in the parent... – khmarbaise Mar 26 '18 at 09:35
  • but the parent pom isn't the reactor's parent. only the child modules' – Eddie Mar 26 '18 at 11:19
  • Maybe I misunderstand your parent/reactor parent..but usually you have a single parent which contains `...` which will handle the building of the others...I don't see the requirement for your separation between parent/reactor ? – khmarbaise Mar 26 '18 at 11:46
  • Sounds like something you can do using maven-assembly-plugin. Specifically, a pluginManagement section in the parent pom (https://maven.apache.org/guides/mini/guide-configuring-plugins.html). – Woodchuck Nov 20 '18 at 22:07

0 Answers0