Gradle’s checkstyle plugin’s configFile literally takes a File and not a URI. The underlying ant task does take a URI, but that’s not exposed. Maybe a JIRA can be created. To get around this, you have to write out the contents of the resource, to a temp directory, then specify that as the configFile.
Concerning getting the file into the classpath, you can do this by putting it in buildSrc or bundling it with a plugin. E.g. I have a netflix-checkstyle plugin who’s sole purpose is to bundle the checkstyle.xml file and then write it out to a temp directory if configFile is not set by the user.