How to override maven property at runtime for a specific module?

Viewed 289

Lets say my project has multiple sub-modules and the structure is something like this:

Parent
 - Submodule-A
 - Submodlue-B
 - Submodule-C 

Now both parent and child poms have the same maven property defined in their pom.xml

<properties>
  <custom.property>some-value</custom.property>
</properties>

If I run the below command, this would override the value for both parent and its child module

mvn <phase|goals> -Dcustom.property=some-other-value

But How do I override this property only for a specific sub-module's pom?

0 Answers
Related