user1685632
user1685632

Reputation: 117

Can we manipulate maven's properties?

Can we add something to a property rather setting value to it? For example in this section:

<properties>
<myCoolProp>text1</myCoolProp>
</properties>

......

<profile>
    <id>add-profile</id>
    <properties>
       <myCoolProp>text2</myCoolProp>
    </properties>
</profile>

I'm trying to get this property myCoolProp = text1text2. Is it possible?

Upvotes: 0

Views: 83

Answers (1)

Steve Chaloner
Steve Chaloner

Reputation: 8202

Use a different name for the base property, and you can control it all you want.

<properties>
  <myCoolPropBase>text1</myCoolPropBase>
</properties>

......

<profile>
  <id>add-profile</id>
  <properties>
    <myCoolProp>${myCoolPropBase}text2</myCoolProp>
  </properties>
</profile>

Upvotes: 1

Related Questions