I have my java class files under build/deploy folder. To execute this locally, I will open cmd in this path and run command
java -classpath .;lib/* mainClass args
Now, I need to achieve same behaviour thru gradle task. My task supposed to run with predefined data and assert the output of this class files. I tried something like
task runWithExec(type: JavaExec) {
group = "Execution"
description = "Run the main class with JavaExecTask"
classpath = files("build/install/lib/*").getAsPath()
main = "mainClass"
}
but I am facing classNotfound exception. And also, how i can assert the output here.