[GRADLE-1352] Improve error message when class cannot be found Created: 25/Jan/11 Updated: 04/Jan/13 Resolved: 26/Jan/11
In the attached build file, I accidentally wrote:
The message I got was:
This was very misleading to me, so it took me take a very long time to figure out what the problem was. A much better error message would be something like:
|Comment by Hans Dockter [ 26/Jan/11 ]|
I know this problem very well. Mostly from working with Groovy. It is very confusing. Responsible for this is the Groovy compiler. Not sure if we can do anything about this.
Peter Niederwieser might have a good idea.
|Comment by Peter Niederwieser [ 26/Jan/11 ]|
There isn't much we can do about the error message, it's just the way Groovy works. The best way to solve this problem is for the plugin author to add a plugin descriptor. Then the plugin can be referenced by ID (apply plugin: "sjit.onejar") rather than class name, and Gradle will issue a meaningful error message if it can't find a plugin with this ID. https://github.com/pniederw/gradle-plugins shows how it is done. I've sent a pull request to https://github.com/RobertFischer/gradle-plugins.