I'm migrating from Maven to Gradle 4.4. There was several maven profiles with such sections:
<properties>
<module.suffix>-14</module.suffix>
<wildfly.hostname>10.***.***.14</wildfly.hostname>
</properties>
There are a lot of ${module.suffix}
in several resource files such as .xml
, .properties
and etc. I was able to run mvn wildfly:deploy -Pdeploy-14
and got my war
deployed with correct suffixes in all files. The problem is: how to do the same in Gradle? I'm new to Gradle but I believe it is modern powerful tool, it must be able to do this with ease.
Help, please.
P.S. The next step of my migration will be setting up the Gradle Wildfly plugin. I didnt try it yet, so if you have any useful advices please welcome.
Gradle task replace string in .java file didn't help (I tried all of the answers, but not sure I did it right).
UPD. When I try do to this
processResources {
def params = [moduleSuffix: 'moduleSuffix']
from 'src/template/resources', {
expand params
}
}
the expand
word is underlined and IDEA says "Cant resolve symbol 'expand'"