I am trying to define a maven property:
<properties>
<property>$${property}</property>
</property>
Maven tries to expand ${property} and I get the following error:
[ERROR] Resolving expression: '${property}': Detected the
following recursive expression cycle in 'property': [property] -> [Help 2]
I have tried all sorts of combinations to try to escape it, without success:
$$
\$
\$$
etc etc
Note: the interpolation is escaped when the property value is not the same as the name.
Is this possible?
Since it seems you can't build a maven property (even with intermediate properties), maybe you can keep 2 separate properties and concatenate them where you need. Let's say you want to populate some property in a file.
Define the 2 variables in the POM:
<properties>
<property>{property}</property>
<dollar>$</dollar>
</properties>
use both when defining the property in the file:
# variable from file which is to be filtered
whatever=${dollar}${property}
and upon filtering you'll end up with:
# variable from file which is to be filtered
whatever=${property}
&
? A configuration such as:
<properties>
<property>&{property}</property>
</properties>
...
<plugins>
<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>echo-maven-plugin</artifactId>
<version>0.2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>echo</goal>
</goals>
</execution>
</executions>
<configuration>
<echos>
<echo>property=[${property}]</echo>
</echos>
</configuration>
</plugin>
</plugins>
will output:
[INFO] --- echo-maven-plugin:0.2:echo (default) @ XXXX ---
[INFO] property=[&{property}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With