Maven 2.x Resources Plugin

maven-resources-plugin 2.4+ filtering broken

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Duplicate
  • Affects Version/s: 2.4
  • Fix Version/s: None
  • Component/s: filtering
  • Labels:
    None
  • Environment:
    Linux (CentOS) 2.6.18-164.el5
  • Number of attachments :
    0

Description

Using maven-resources-plugin version 2.4 or newer, fails to filter some files. This was a nasty one to find because it only affects certain files. If you create a file to be filtered with the following lines:

<%@ taglib prefix="NAME1" uri="http://www.sun.com/tags2" %>
<%@ taglib prefix="NAME2" uri="http://www.sun.com/tags" %>
<%@ taglib prefix="NAME3" uri="http://www.sun.com/test/tags" %>
${taglibFnInclude}

and define the taglibFnInclude property to some value, e.g:

<taglibFnInclude>MY-STRING</taglibFnInclude>

a "mvn resources:resources" build will will not filer the file. If you add another line above the property value or delete a line, the file gets filtered properly. E.g, the following work:

<%@ taglib prefix="NAME1" uri="http://www.sun.com/line1" %>
<%@ taglib prefix="NAME2" uri="http://www.sun.com/line2" %>
<%@ taglib prefix="NAME3" uri="http://www.sun.com/line3/tags" %>
<%@ taglib prefix="NAME4" uri="http://www.sun.com/line4/tags" %>
${taglibFnInclude}

AND

<%@ taglib prefix="NAME1" uri="http://www.sun.com/line1" %>
<%@ taglib prefix="NAME2" uri="http://www.sun.com/line2" %>
${taglibFnInclude}

If I go back to version 1.3 of this plugin, everything works as it should.

Issue Links

Activity

Hide
Sheldon Daigle added a comment -

I meant to specify version 2.3 (not 1.3) of the resources plugin worked.

Show
Sheldon Daigle added a comment - I meant to specify version 2.3 (not 1.3) of the resources plugin worked.
Hide
Olivier Lamy added a comment -

@ is part of filtering tokens.
What you could do is to configure resources plugin as this:

<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>${*}</delimiter>
</delimiters>
Show
Olivier Lamy added a comment - @ is part of filtering tokens. What you could do is to configure resources plugin as this:
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>${*}</delimiter>
</delimiters>
Hide
Sheldon Daigle added a comment -

Thanks Olivier. That worked. Any idea why 2.3 of the plugin works and the later versions don't?

Show
Sheldon Daigle added a comment - Thanks Olivier. That worked. Any idea why 2.3 of the plugin works and the later versions don't?
Hide
Olivier Lamy added a comment -

just because we have added this new token @ in the filtering.

Show
Olivier Lamy added a comment - just because we have added this new token @ in the filtering.
Hide
Cornel Masson added a comment - - edited

Why is Ant (and Maven + Antrun) capable of filtering @...@ tokens correctly in files containing other @ symbols, but Maven resources-plugin not?

I welcome the @ delimeter as a default, but then it should work out of the box with any file - @ is quite a common symbol in many text files, e.g. ones containing e-mail addresses. Windows batch scripts also fall fowl of this bug.

Show
Cornel Masson added a comment - - edited Why is Ant (and Maven + Antrun) capable of filtering @...@ tokens correctly in files containing other @ symbols, but Maven resources-plugin not? I welcome the @ delimeter as a default, but then it should work out of the box with any file - @ is quite a common symbol in many text files, e.g. ones containing e-mail addresses. Windows batch scripts also fall fowl of this bug.
Hide
Arnaud Heritier added a comment -

For me it's a real bug. We have to solve it with MRESOURCES-104 and related

Show
Arnaud Heritier added a comment - For me it's a real bug. We have to solve it with MRESOURCES-104 and related
Hide
Arnaud Heritier added a comment -

Should be fixed by PLXCOMP-150

Show
Arnaud Heritier added a comment - Should be fixed by PLXCOMP-150

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: