JavaExec bootstrapClasspath docs and behaviour don't match

The docs of the bootstrapClasspath method state: “Adds the given values to the end of the bootstrap classpath for the process.”

However, the bootclasspath per se is replaced, leading to “java/lang/NoClassDefFoundError: java/lang/Object” because not even the rt.jar is available anymore.

Here’s a build.gradle to illustrate the problem:

I’m not sure if this is expected behaviour - it wasn’t to me. So maybe updating the docs will suffice. On the other hand, adding a way to mangle specifically the prepended and appended bootclasspath components is likely helpful to others too. I came across this problem while adding the npn-boot library to enable spdy in dropwizard.