This message was deleted.
# plugin-development
s
This message was deleted.
p
The following plugin code gives the same result:
Copy code
final var service = project.getGradle().getSharedServices().registerIfAbsent("metal",MetalService.class,it -> {});
project.getExtensions().create("metal",MetalExtension.class,service.flatMap(MetalService::getHost));
e
if your plugin is loaded in multiple projects, make sure that it exists in the parent classpath (e.g. load it in the root project, possibly with
apply false
). otherwise multiple projects will load your plugin in different classloaders and classes from separate classloaders are different even if they are named the same.
👍 1
p
Thank you! That did the trick. This seems to me a usability problem with shared build services.