# Gradle way of processing resources with maven notation

**URL:** <https://discuss.gradle.org/t/gradle-way-of-processing-resources-with-maven-notation/4948>\
**Category:** Old Forum Archive\
**Created:** [February 4, 2014, 8:46pm UTC](https://discuss.gradle.org/t/gradle-way-of-processing-resources-with-maven-notation/4948 "2014-02-04T20:46:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![suman\_jakkula](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@suman\_jakkula](https://discuss.gradle.org/u/suman_jakkula)\
**Post date:** [February 4, 2014, 8:46pm UTC](https://discuss.gradle.org/t/gradle-way-of-processing-resources-with-maven-notation/4948/1 "2014-02-04T20:46:00Z")

</div>

I have few maven resource property files with ${} notation. I am working on migrating this project to gradle. processTestResources task is not replacing the values in ${}. Based on googling this is because gradle is using ant token identification which expects ‘@…@’ syntax.

How do we process resources in maven token format? i.e ${}

Is there any out-of-the box solution or should I have to write a custom processor?

---

<div class="post-metadata">

**Author:** ![suman\_jakkula](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@suman\_jakkula](https://discuss.gradle.org/u/suman_jakkula)\
**Post date:** [February 4, 2014, 9:46pm UTC](https://discuss.gradle.org/t/gradle-way-of-processing-resources-with-maven-notation/4948/2 "2014-02-04T21:46:00Z")

</div>

I was able to do it thru ugly hack.

```gradle
configure(tasks.processTestResources) {
    include '**/*.properties'
    filter(ReplaceTokens,
            tokens: ['$':'={'], beginToken : '=', endToken : '{')
    filter(ReplaceTokens,
            tokens: [project.properties], beginToken : '{', endToken : '}')
}

```

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [February 5, 2014, 3:56pm UTC](https://discuss.gradle.org/t/gradle-way-of-processing-resources-with-maven-notation/4948/3 "2014-02-05T15:56:00Z")

</div>

You can try using the built-in ‘expand’ support that uses the Groovy SimpleTemplateEngine:&nbsp;[http://www.gradle.org/docs/current/userguide/working\_with\_files.html#N111EF](http://www.gradle.org/docs/current/userguide/working_with_files.html#N111EF)  
  
Or you can use the Ant ‘ExpandProperties’ filter, as described at&nbsp;[http://stackoverflow.com/questions/7276368/how-can-i-get-ant-behavior-when-expanding-properties-with…](http://stackoverflow.com/questions/7276368/how-can-i-get-ant-behavior-when-expanding-properties-with-gradle "Link: http://stackoverflow.com/questions/7276368/how-can-i-get-ant-behavior-when-expanding-properties-with-gradle")
