Main class not found when using Manifest jar with JavaExec

I have the below gradle script from the Jhipster framework. It is used to run Gatling tests and due to the command line limit on windows I have tried using a manifest only jar approach. A detailed discussion regarding this can be found here Jhipster issue
But the below script seems to generate the Manifest jar properly but JavaExec is unable to find the main class, some pointer on this would be really helpfull. A console log of error is below as well

apply plugin: 'scala'

sourceSets {
    test {
        scala {
            srcDirs = ['src/test/gatling/simulations']
            output.classesDir = 'target/test-classes'
        }
    }
}
task manifestJar(dependsOn:'compileTestScala',type: Jar) {
    dependsOn configurations.runtime
    classifier 'pathing'
    doFirst {
        manifest {
            // uri is just needed for Windows-compatibility
            attributes 'Class-Path': configurations.runtime.files.collect{ project.uri(it) }.join(' ')
        }
    }
}
task gatlingRun(dependsOn:'manifestJar', type: JavaExec) {
    //dependsOn configurations.runtime
    group = "gatling"

    standardInput = System.in

    final def sourceSet = sourceSets.test
    File configFile = file('src/test/gatling/conf/gatling.conf')

    def String gatlingDataFolder = "$project.rootDir.absolutePath/src/test/gatling/data"
    def String gatlingReportsFolder = "$project.buildDir.absolutePath/reports/gatling"
    def String gatlingBodiesFolder = "$project.rootDir.absolutePath/src/test/gatling/bodies"
    def String gatlingSimulationsFolder = "$project.rootDir.absolutePath/src/test/gatling/simulations"

    //classpath sourceSet.output + sourceSet.runtimeClasspath + files("src/test/gatling/conf")
    classpath sourceSet.output + files(manifestJar.archivePath) + files("src/test/gatling/conf")
    //classpath = files(pathingJar.archivePath)
    main = "io.gatling.app.Gatling"

    environment GATLING_HOME:''

    args '-df', gatlingDataFolder
    args '-rf', gatlingReportsFolder
    args '-bdf', gatlingBodiesFolder
    args "-sf", gatlingSimulationsFolder
    args "-rd", ""

}

Console log:

:compileTestJava UP-TO-DATE
:compileTestJava (Thread[main,5,main]) completed. Took 0.973 secs.
:compileTestScala (Thread[main,5,main]) started.
:compileTestScala
Skipping task ':compileTestScala' as it is up-to-date (took 0.325 secs).
:compileTestScala UP-TO-DATE
:compileTestScala (Thread[main,5,main]) completed. Took 0.344 secs.
:manifestJar (Thread[main,5,main]) started.
:manifestJar
Skipping task ':manifestJar' as it is up-to-date (took 0.012 secs).
:manifestJar UP-TO-DATE
:manifestJar (Thread[main,5,main]) completed. Took 0.038 secs.
:processTestResources (Thread[main,5,main]) started.
:processTestResources
Skipping task ':processTestResources' as it is up-to-date (took 0.013 secs).
:processTestResources UP-TO-DATE
:processTestResources (Thread[main,5,main]) completed. Took 0.041 secs.
:testClasses (Thread[main,5,main]) started.
:testClasses
Skipping task ':testClasses' as it has no actions.
:testClasses UP-TO-DATE
:testClasses (Thread[main,5,main]) completed. Took 0.019 secs.
:gatlingRun (Thread[main,5,main]) started.
:gatlingRun
Executing task ':gatlingRun' (up-to-date check took 0.001 secs) due to:
  Task has not declared any outputs.
Starting process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe''. Working directory: D:\Projects\jh5 Command: C:\Program Files\Java\jdk1.8.
0_45\bin\java.exe -Dfile.encoding=windows-1252 -Duser.country=SG -Duser.language=en -Duser.variant -cp D:\Projects\jh5\target\test-classes;D:\Projects
\jh5\build\resources\test;D:\Projects\jh5\build\libs\jhipster-pathing.jar;D:\Projects\jh5\src\test\gatling\conf io.gatling.app.Gatling -df D:\Projects
\jh5/src/test/gatling/data -rf D:\Projects\jh5\build/reports/gatling -bdf D:\Projects\jh5/src/test/gatling/bodies -sf D:\Projects\jh5/src/test/gatling
/simulations -rd
Successfully started process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe''
Error: Could not find or load main class io.gatling.app.Gatling
:gatlingRun FAILED
:gatlingRun (Thread[main,5,main]) completed. Took 0.166 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gatlingRun'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 28.134 secs
Stopped 0 compiler daemon(s).