I had to properly define the classpath
classpath = sourceSets.main.runtimeClasspath mainClass = 'com.xxxx.xxxx.xxxx'