Is it possible to read values from properties file(say a database property file) in my code generator xml configuration file?
For Example, I have all my database properties stored in a separate file like:-
db.properties
local.datasource.url=jdbc:mysql://localhost:3307
local.datasource.username=testuser
local.datasource.password=testpassword
local.datasource.driver-class-name=com.mysql.jdbc.Driver
Above connection information is being used by my application to access database. I want my jooqCodeGen.xml to look somewhat like this:
jooqCodeGen.xml
<jdbc>
<driver>${local.datasource.driver-class-name}</driver>
<url>${local.datasource.url}</url>
<user>${local.datasource.username}</user>
<password>${local.datasource.password}</password>
</jdbc>
...
So that I don't have to duplicate the properties. I am triggering JOOQ code generation Tool from build.gradle
Build.gradle
task generateJooqDatabaseSource(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'org.jooq.util.GenerationTool'
args = ['/jooqCodeGen.xml']
standardOutput = System.out
errorOutput = System.err
}
Is there a way we can achieve this?