views:

20

answers:

1

I am using the Maven assembly plugin to prepare some configuration artifacts for different environments, and I am using resource filtering to substitute parameter values.

I came across a weird behaviour where I had a property file with the contents as follows:


###########################

# [email protected] #

############################

env.name=${replacement.value}


The presence of the '@' symbol for the author's e-mail was causing all property references to be ignored.

I have tried looking for documentation as to why this happens - but cannot find anything that answers this behaviour. Any helpful pointers to documention or an explanation would be much appreciated.

For reference:

  1. Maven version: 2.2.1
  2. Maven Assembly Plugin version: 2.2
A: 

I have tried looking for documentation as to why this happens - but cannot find anything that answers this behaviour. Any helpful pointers to documentation or an explanation would be much appreciated.

This is not documented in the filtering section of the Maven Assembly Plugin but it looks like it uses the same default delimiters as the Maven Resources Plugin which are:

<delimiters>
  <delimiter>${*}</delimiter>
  <delimiter>@</delimiter>
</delimiters>

So the following would be filtered as well:

[email protected]@

And this also explains why a single @ in the email address is causing troubles (the pluging never finds the end delimiter).

That said, while it is possible to configure the behavior (or even to declare an escape string) when using the Maven Resources Plugin, I don't know if the same is doable - and how - with the Assembly Plugin. A cheap workaround would be to avoid using a singe @ in the file to filter:

##############################
# author.name aT company.com #
##############################

env.name=${replacement.value}

And as a benefit, you'll avoid spam :)

Pascal Thivent