How to reuse Maven profile?

291 Views Asked by At

We have multiple independent maven projects that use two profiles. Currently, these profiles are part of pom.xml and copied to all projects. Is there a way to reuse the Maven profile across all services?

1

There are 1 best solutions below

0
On BEST ANSWER

You can place profiles in a parent POM and use that parent in your projects.

Then the projects inherit the profiles from the parent POM.

Note that you do not need to create a multi-module project for that. An ordinary parent POM suffices.