I’m trying to pass an instance of an object with a FileCollection
property to the WorkerConfiguration
parameters. Unfortunately I get following error Could not serialize parameters
. The object itself implements Serializable
, however FileCollection
does not. If I remove the FileCollection
property everything works fine.
I attached a small example below:
class Test implements Serializable {
String id
FileCollection target
}
class TestTask extends DefaultTask {
def workerExecutor
def tests = []
@Inject
FileEncodingTask(WorkerExecutor workerExecutor) {
this.workerExecutor = workerExecutor
}
@TaskAction
def action() {
this.tests.each { test ->
this.workerExecutor.submit(TestThread.class) { WorkerConfiguration conf -> // TestThread implements Runnable
conf.isolationMode = IsolationMode.NONE
conf.params = [test]
}
}
}
}
How can I pass the object with FileCollection
to params
? What I’m missing?