jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Maven 2.x Resources Plugin
  • Maven 2.x Resources Plugin
  • MRESOURCES-134

EspaceString doesn't work

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 2.5
  • Fix Version/s: None
  • Component/s: escape string
  • Labels:
    None
  • Environment:
    maven 2.2.1
  • Number of attachments :
    2

Description

if I configure the maven-resource-plugin in order to escape a delimiter in a comment, the escapeString is not removed in the target.

src/main/resources/properties/test.properties
#%comment to espace:§@toto
question=@message@
pom.xml
 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-resources-plugin</artifactId>
   <version>2.5-SNAPSHOT</version>
   <configuration>
     <escapeString>§</escapeString>
   </configuration>  
 </plugin>
target/classes/properties/test.properties
#%comment to espace:§@toto
question=A nice message...
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    maven-resources-plugin-EscapeString.zip
    10/Jan/11 11:32 AM
    1 kB
    Rémy Sanlaville
    1. XML File
      maven-resources-plugin-EscapeString/pom.xml 1 kB
    2. Text File
      maven-resources-plugin-EscapeString/.../filters-values.txt 0.1 kB
    3. File
      maven-resources-plugin-EscapeString/.../test.properties 0.1 kB
    Download Zip
    Show
    Zip Archive
    maven-resources-plugin-EscapeString.zip
    10/Jan/11 11:32 AM
    1 kB
    Rémy Sanlaville
  2. Hide
    Zip Archive
    MRESOURCES-134.zip
    17/Jan/11 1:48 PM
    2 kB
    Dennis Lundberg
    1. XML File
      MRESOURCES-134/pom.xml 1.0 kB
    2. Text File
      MRESOURCES-134/src/.../filters-values.txt 0.1 kB
    3. File
      MRESOURCES-134/src/.../test.properties 0.1 kB
    Download Zip
    Show
    Zip Archive
    MRESOURCES-134.zip
    17/Jan/11 1:48 PM
    2 kB
    Dennis Lundberg

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Rémy Sanlaville added a comment - 10/Jan/11 11:45 AM

I also try with #%comment to espace:§@toto@ and I have the same problem.

Show
Rémy Sanlaville added a comment - 10/Jan/11 11:45 AM I also try with #%comment to espace:§@toto@ and I have the same problem.
Hide
Permalink
Olivier Lamy added a comment - 11/Jan/11 11:11 AM

IMHO this must be WON'T FIX
see http://maven.apache.org/plugins/maven-resources-plugin/examples/escape-filtering.html
escapeString is here to prevent escaping.
So in your line : #%comment to espace:§@toto
I don't see any filtering because the end token is missing.
Désolé

Show
Olivier Lamy added a comment - 11/Jan/11 11:11 AM IMHO this must be WON'T FIX see http://maven.apache.org/plugins/maven-resources-plugin/examples/escape-filtering.html escapeString is here to prevent escaping. So in your line : #%comment to espace:§@toto I don't see any filtering because the end token is missing. Désolé
Hide
Permalink
Dennis Lundberg added a comment - 11/Jan/11 1:29 PM

I agree with Olivier. This is working as it should. No change is needed.

By the way, your sample project has an invalid character as the escapeString. It just shows up as a question mark icon in my Java based IDE. That could explain why you are having problems.

Show
Dennis Lundberg added a comment - 11/Jan/11 1:29 PM I agree with Olivier. This is working as it should. No change is needed. By the way, your sample project has an invalid character as the escapeString. It just shows up as a question mark icon in my Java based IDE. That could explain why you are having problems.
Hide
Permalink
Rémy Sanlaville added a comment - 12/Jan/11 3:19 AM

As I said, I also try with #%comment to espace:§@toto@ and I have the same problem.
I don't think it is working as it should.
Isn't it the same to RESOURCES-110

Also, how to deal with this case?

question=@message@
mailbox =contact@toto.com

where I want to escape the @ of contact@toto.com

Dennis, In fact I wasn't in UTF-8 encoding but it does not change anything.

Show
Rémy Sanlaville added a comment - 12/Jan/11 3:19 AM As I said, I also try with #%comment to espace:§@toto@ and I have the same problem. I don't think it is working as it should. Isn't it the same to RESOURCES-110 Also, how to deal with this case? question=@message@ mailbox =contact@toto.com where I want to escape the @ of contact@toto.com Dennis, In fact I wasn't in UTF-8 encoding but it does not change anything.
Hide
Permalink
Rémy Sanlaville added a comment - 12/Jan/11 3:48 AM

With the last 2.5-SNAPSHOT it's now working. I do not have to define an escapeString in my property file

src/main/resources/properties/test.properties
#%comment:@toto
question=@message@
mailbox =contact@toto.com
other.question=@validation@
target/classes/properties/test.properties
#%comment: @toto
question=A nice message...
mailbox =contact@toto.com
other.question=A validation message ?

But, strangely, I have to configure the maven resource plugin with escapeString otherwise it does not work.

Also, #%comment to espace:§@toto does not work but it don't need it now.

Show
Rémy Sanlaville added a comment - 12/Jan/11 3:48 AM With the last 2.5-SNAPSHOT it's now working. I do not have to define an escapeString in my property file src/main/resources/properties/test.properties #%comment:@toto question=@message@ mailbox =contact@toto.com other.question=@validation@ target/classes/properties/test.properties #%comment: @toto question=A nice message... mailbox =contact@toto.com other.question=A validation message ? But, strangely, I have to configure the maven resource plugin with escapeString otherwise it does not work. Also, #%comment to espace:§@toto does not work but it don't need it now.
Hide
Permalink
Dennis Lundberg added a comment - 12/Jan/11 10:54 AM

Your example

question=@message@
mailbox =contact@toto.com

works out of the box in 2.5-SNAPSHOT. You don't have to add any escapeString for it to work.

The escapeString parameter has no default value, which is why you have to configure it.

Show
Dennis Lundberg added a comment - 12/Jan/11 10:54 AM Your example question=@message@ mailbox =contact@toto.com works out of the box in 2.5-SNAPSHOT. You don't have to add any escapeString for it to work. The escapeString parameter has no default value, which is why you have to configure it.
Hide
Permalink
Rémy Sanlaville added a comment - 14/Jan/11 11:27 AM

The escapeString parameter seems to have default value

Expression preceded with the String won't be interpolated \${foo} 
will be replaced with ${foo}.
Default value is: ${maven.resources.escapeString}.

Also I don't understand why I have to configure the plugin if I don't need any escapeString. If I remove this configuration, it does not work...

pom.xml
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-resources-plugin</artifactId>
   <version>2.5-SNAPSHOT</version>
   <configuration>
     <escapeString>§</escapeString>
   </configuration>  
 </plugin>
Show
Rémy Sanlaville added a comment - 14/Jan/11 11:27 AM The escapeString parameter seems to have default value Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}. Default value is: ${maven.resources.escapeString}. Also I don't understand why I have to configure the plugin if I don't need any escapeString. If I remove this configuration, it does not work... pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.5-SNAPSHOT</version> <configuration> <escapeString>§</escapeString> </configuration> </plugin>
Hide
Permalink
Dennis Lundberg added a comment - 15/Jan/11 5:12 AM

The escapeString does not have a default value. The text you are referring to is the "expression" for the parameter. This is a way to configure a value for through the command line. It would look like this:

mvn process-resources -Dmaven.resources.escapeString=§

By the way, where did you find that text? We should try to improve the documentation.

If you do not configure the escapeString no escaping should be done. So your example should work. Can you assemble a zip-file with the files you are using so that we can verify this?

Show
Dennis Lundberg added a comment - 15/Jan/11 5:12 AM The escapeString does not have a default value. The text you are referring to is the "expression" for the parameter. This is a way to configure a value for through the command line. It would look like this: mvn process-resources -Dmaven.resources.escapeString=§ By the way, where did you find that text? We should try to improve the documentation. If you do not configure the escapeString no escaping should be done. So your example should work. Can you assemble a zip-file with the files you are using so that we can verify this?
Hide
Permalink
Olivier Lamy added a comment - 15/Jan/11 4:11 PM

documentation fixed in rev 1059420

Show
Olivier Lamy added a comment - 15/Jan/11 4:11 PM documentation fixed in rev 1059420
Hide
Permalink
Rémy Sanlaville added a comment - 17/Jan/11 7:53 AM

@Dennis: The text was taken from the documentation (http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html). Thanks @Olivier for the fixed.

You can try with the attached example maven-resources-plugin-EscapeString.zip
If I remove the resource plugin configuration, I have this result (even with the last 2.5-SNAPSHOT version)

target/classes/properties/test.properties
#%comment: @toto
question=@message@
mailbox =contact@toto.com

#%comment
other.question=A validation message ?
Show
Rémy Sanlaville added a comment - 17/Jan/11 7:53 AM @Dennis: The text was taken from the documentation ( http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html ). Thanks @Olivier for the fixed. You can try with the attached example maven-resources-plugin-EscapeString.zip If I remove the resource plugin configuration, I have this result (even with the last 2.5-SNAPSHOT version) target/classes/properties/test.properties #%comment: @toto question=@message@ mailbox =contact@toto.com #%comment other.question=A validation message ?
Hide
Permalink
Dennis Lundberg added a comment - 17/Jan/11 1:48 PM

Rémy,

Here's a sample project that looks like the one you are describing. This is working nicely for me. Can you please try it and see if it works for you?

Show
Dennis Lundberg added a comment - 17/Jan/11 1:48 PM Rémy, Here's a sample project that looks like the one you are describing. This is working nicely for me. Can you please try it and see if it works for you?
Hide
Permalink
Rémy Sanlaville added a comment - 18/Jan/11 2:18 AM

Dennis,

It works well for both your sample project and mine too (today).
I don't know why yesterday mine didn't worked.

Anyway, I'm glad that it's working as expected.
Thanks.

Show
Rémy Sanlaville added a comment - 18/Jan/11 2:18 AM Dennis, It works well for both your sample project and mine too (today). I don't know why yesterday mine didn't worked. Anyway, I'm glad that it's working as expected. Thanks.
Hide
Permalink
Dennis Lundberg added a comment - 18/Jan/11 2:53 PM

Thanks for helping us verify that it is fixed.

Show
Dennis Lundberg added a comment - 18/Jan/11 2:53 PM Thanks for helping us verify that it is fixed.

People

  • Assignee:
    Olivier Lamy
    Reporter:
    Rémy Sanlaville
Vote (0)
Watch (0)

Dates

  • Created:
    10/Jan/11 11:32 AM
    Updated:
    18/Jan/11 2:53 PM
    Resolved:
    11/Jan/11 1:29 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.