I created a JavaExec task that connects to a db and does some checks. In my flyway build.gradle I call the task like this:
flywayMigrate.finalizedBy(rootProject.checkOracleStandards)
The task works fine, but the problem is that the connection url, user and password are hardcoded in the program that connects to the db and does the checks. I want to pass them as args to the custom task.
How to run the custom task with args after flywayMigrate?
This is how my task gradle file looks like:
apply plugin: 'java'
dependencies {
implementation rootProject.files("libs/check-oracle-db-standards-1.jar")
implementation group: 'com.oracle.database.jdbc', name: 'ojdbc8', version: '21.3.0.0'
implementation group: 'org.springframework', name: 'spring-jdbc', version: '5.3.13'
implementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
}
task checkOracleStandards(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.package.checkoracledbstandards.Main'
}