Can I define variables in gradle, which are fill in the placeholders in the persistence.xml?
Example
gradle.properties:
dev.classes= <class>my.package.class</class>.....<class>my.package.class</class>
persistence.xml
<persistence>
<persistence-unit name "a">
<!--define a variable that will be overwritten by build.gradle-->
...
</persistence-unit>
</persistence>
build.gradle
task replaceTokens {
from(//persistence.xml path) {
filter(ReplaceTokens, tokens: [//variable in xml, //value in gradle.properties])
}
}
I need it, because I have more persistence-units in my persistence.xml, which all needs the same classes. Currently the classes are in all persistence-unit "hardcoded". It would be nicer, if I can define it only once.