No such errors occur when extending DefaultTask and providing a @TaskAction that calls project.exec(), which might be the workaround I should use. But what is so special about the Exec task class?
There isn’t anything special about the Exec task that should prevent you from extending it. It seems like you might be having an issue with groovy-eclipse, not the actual code. Your code, as written, should compile just fine with plain groovyc. Have you attempted to build it without the IDE?
In either case, I think you will find that many plugin authors consider the work-around you mentioned to be preferred over task extension, often with additional delegation (i.e. the task delegates to an exec runner API, which encapsulates the actual implementation, such as project.exec(), ProcessBuilder, or others).
You should also look at the Grolifant library (https://ysb33rorg.gitlab.io/grolifant) which will allow you to more crafty things around external tool execution)