maven


Is it possible to escape maven property interpolation when the property value string is the same as the property name?


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}
What about using &? 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}]
${property} should work fine.

Related Links

org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2 error
Using the properties tag within maven profiles
Embedded tomcat won't let my selenium/jbehave stories run
GWT & Maven: applying code formatter
Best practices in naming conventions on Maven artifactID (is there restriction?)
“Non-resolvable parent POM” with Play framework project using Maven
Keep getting java.lang.OutOfMemoryError: PermGen space error
copy dependencies transitive and not transitive
jetty-maven-plugin setting buffers sizes
Grails refresh-dependencies doesn't download snapshot dependency from local maven repository
Copy test resources from one submodule to the others
What is an uber jar?
Add jar file to Maven Reactor modules list
JAX-WS with Spring integration with Jetty server
POM for 'log4j:log4j:pom:1.2.15:compile' is invalid
Adding a set of dependencies in maven

Categories

HOME
testing
dictionary
reserved
relayjs
youtube-api-v3
umd
callback
convolution
azure-storage-tables
directx
bs4
webrequest
maude-system
google-cloud-spanner
apache-cayenne
messages
progressive-web-apps
footer
google-static-maps
predix
cultureinfo
hammerspoon
firebase-crash-reporting
apache-commons-io
user-interaction
elasticsearch-net
quote
flink-streaming
nat
phonegap
google-cloud-endpoints-v2
airconsole
karaf
hot-module-replacement
service-discovery
uft-api
leading-zero
mapzen
fedex
ibpy
python-cryptography
zendesk-app
deadbolt-2
vmware-tools
rotativa
android-textview
savon
mongocsharpdriver
react-native-listview
pickadate
captivenetwork
revolution-r
browser-link
maven-tomcat-plugin
endeca-workbench
eclipse-clp
feedback
quicklisp
javax.mail
csquery
internet-connection
rdl
starcluster
braille
bundles
hyprlinkr
cdc
flash-builder4.5
html4
yui-compressor
bigcouch
netdna-api
qt-jambi
tomcat-valve
appender
pyinotify
oncheckedchanged
fluent-interface
icanhaz.js
asp.net-profiles
defensive-programming

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App