old-style.gradle is the one that works, and new-style.gradle, which contains the plugins block, fails. The error that is reported is directly related to the plugin not seeing the appropriate JARs on the classpath when it is applied.
Can you tell us a bit more about how the plugin decides which URI schemes to activate? I debugged and can see that the http-client jar is on the classpath and the classloader of your plugin can see the HttpClient class. So I’m a little lost as to why it would not work.
VFS allows for double-barrel scheme names i.e. zip:http://foo/path/file.zip which allows for file.zip to be downloaded to a temporary file store, and then be interpreted as a ZIP in a way that is transparent to the used
I think I found the problem: The StandardFileSystemManager uses the current Thread’s context classloader. That classloader is different for the logic running inside the plugins block. If the plugin used getClass().getClassLoader() instead, it would work.
I’m going to bring this up for internal discussion, as other plugin authors might trip over this slight change in the environment that the plugin runs in. Thanks for taking the time to walk me through your plugin
I definitely would be interested in what the outcome of that discussion would be. If need be I can craft up a version of the plugin on a branch that uses a different classloader to test any ideas forthcoming.