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

Spring boot - JPA with QueryDSL custom query implementation - entity not mapped error
Idea's cmd and git bash don't see mvn command
jenkins - version placeholder from previous build POM
Can JRebel reload Kotlin classes when they are used by kotlin-maven-plugin plugin on maven?
Incremental build with maven#3.3.3 in multi module project
Maven: execute cli command based on profile (if else)
List the remote repositories used in gradle project by parsing build.gradle from a maven project
How to customize colors in maven 3.5 console output
how to let jacoco know sources/classes are outside the module
how to sharing a karaf feature without a maven repository?
spring boot with maven multi level module
maven build ear - how I can build just a .ear file and not the exploded ear dir?
How to depend a POM with several modules in Maven
Unknown repository update policy 'daily ', assuming 'never
Toggling between provided and included for spark binaries in local run mode
I am running a maven project with package goal, it creates a .zip folder but no jar. Why is that?

Categories

HOME
ibm-bluemix
wso2
atom-editor
blogger
cookies
relay
read-eval-print-loop
cvs
cmd
electronics
jxls
ckeditor
ojdbc
add
virtualization
maude-system
metatrader4
reveal.js
commonmark
decomposition
caml
worldwind
transformation
emgucv
internet-explorer-9
fifo
quote
preg-match-all
openoffice.org
xmlreader
cloud-code
mpmediaquery
overriding
ssjs
particles.js
reportingservices-2005
elmah
nand2tetris
nxlog
businessworks
sencha-touch-2.3
convertapi
cubic-spline
user-accounts
dotcover
youcompleteme
boost-multi-index
fancybox-2
drupal-6
directory-structure
nodebb
lift-json
libusb-win32
knpmenubundle
cudafy.net
arrow-keys
sqldf
setuptools
vmware-tools
probability-density
bonobo
trash
bstr
python-stackless
rvest
cloudbees
reactive-banana
sdhc
feedback
citrus-pay
tarjans-algorithm
createprocessasuser
c3
didselectrowatindexpath
balanced-payments
intentservice
file-locking
batterylevel
back-stack
kyotocabinet
anonymous-methods
viewswitcher
hamachi
f#-powerpack
xtype
locationlistener
oncheckedchanged
bespin
nerddinner
putchar
scripting-languages
dbisam
data-acquisition
ntvdm.exe

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App