Search code examples
mavenmaven-3

Maven variable : Dollar vs Arobase?


In this documentation, it is suggested to use "@{argLine}". What is the difference between "@{argLine}" and "${argLine}" ? Is there a scope difference ?

Is this documented in maven doc ? (can't find it...).


Solution

  • @{argLine} instead of the usual ${argLine} is called "late property evaluation". This is only supported by the Maven Surefire Plugin.

    From the documentation:

    How do I use properties set by other plugins in argLine?

    Maven does property replacement for ${...} values in pom.xml before any plugin is run. So Surefire would never see the place-holders in its argLine property.

    Since the Version 2.17 using an alternate syntax for these properties, @{...} allows late replacement of properties when the plugin is executed, so properties that have been modified by other plugins will be picked up correctly.