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

How to integrate maven with cruise control?
Hue won't build due to missing Thrift classes.
Named-Entities Recognition with OpenCalais
How can I copy artifacts with all dependencies from one maven repository into another?
Check maven version in pom.xml
Maven bundles multiple versions of same libraries in WAR
Exclude JAR from maven assembly
How to combine one root level pom to child pom?
Maven version ranges and suffixed versions in IntelliJ Idea
setting maven proxy settings outside of settings.xml
Multimodule maven java doc build
Maven 2 - dependency type directory
Running Maven and Sonatype Nexus while offline with no internet connection
maven jar-with-dependencies log4j
Execute maven plugin goal jetty:run on Intellij error: “Permission denied”
How to correctly add dependencies in Maven

Categories

HOME
pandas
log4j
image
omnet++
comparison
syntax
fme
grep
xmpp
framework7
mvvmcross
azure-media-services
google-cloud-ml
google-cloud-spanner
jplayer
dtrace
fortumo
decomposition
caml
uitypeeditor
ghc
progressive-web-apps
tostring
windows-7-x64
apache-metamodel
undefined
jqwidget
text-rendering
visjs
jasonette
arabic
web-sql
mmap
format-specifiers
p-value
spark-jobserver
atlassian-crucible
nat
nouislider
frame
functor
airconsole
bytecode-manipulation
lto
hockeyapp
mixture-model
tasker
optix
pdf-reactor
midl
vao
total-commander
flashair
reactive-cocoa-5
angular2-meteor
apple-news
cubic-spline
youcompleteme
dropbox-php
aurelia-validation
gcsfuse
bind9
eventkit
yt-project
word-vba-mac
probability-density
log4c
phishing
merge-conflict-resolution
fuzzy-search
ubuntu-10.04
hill-climbing
captivenetwork
bluemix-app-scan
goose
system.management
netmq
quicklisp
computer-algebra-systems
nsight
nsmutabledictionary
sgen
doskey
html5-notifications
gnu-smalltalk
dexterity
file-locking
hungarian-algorithm
sabredav
bluepill
venn-diagram
datawindow
armcc
labwindows
twrequest
assembly-loading
whoosh
boost-filesystem
spyware
gcj
genshi
horizontal-accordion
lang
subviews
dbal
exchange-server-2003
nerddinner
zune
mdac
windows-live-messenger
document-conversion

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