The following Groovy script fails with a java.lang.ClassNotFoundException: com.mysql.jdbc.Driver exception.

@Grapes([
    @Grab('mysql:mysql-connector-java:5.1.25')
])

import groovy.sql.Sql

def sql = Sql.newInstance(
    'jdbc:mysql://localhost/books', 
    'root',
    '', 
    'com.mysql.jdbc.Driver'
);

I looked into the JAR file stored at C:\Users\Dusan\.groovy\grapes\mysql\mysql-connector-java\jars\mysql-connector-java-5.1.25.jar and it contains the Driver class.

What can be wrong?

Edit
Report