Setting a property for only a specific phase

190 Views Asked by At

I want to be able to set a property for a specific maven phase. How can I do that?

For example, assume that I want to set a property like this:

<properties>
    <spring.profiles.active>production<spring.profiles.active>
</properties>

only when one is executing mvn package. I know that I can manually set a property, but I want it to be automatic so it is not forgotten.

1

There are 1 best solutions below

0
J Fabian Meier On

This is not possible.

But probably there is a solution for the original problem you want to solve. Please write a new question which describes the use case.