diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTask.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTask.java index 6ab8694219..261e9d208b 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTask.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTask.java @@ -385,7 +385,7 @@ protected void doApply(Plugin.Engine.Source source, Plugin.Engine.Target target) if (undiscoverable.add(name)) { try { @SuppressWarnings("unchecked") - Class plugin = (Class) Class.forName(name); + Class plugin = (Class) Class.forName(name, false, classLoader); Transformation transformation = new Transformation(); transformation.setPlugin(plugin); transformations.add(transformation); diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyPlugin.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyPlugin.java index b450952e99..2c13034fbc 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyPlugin.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyPlugin.java @@ -112,7 +112,7 @@ public void execute(JavaPlugin plugin) { extension = DISPATCHER.toExtension(project); } extension.resolve(configuration.getTargetCompatibility()); - extension.discoverySet(project.getConfigurations().create(name)); + extension.discoverySet(project.getConfigurations().maybeCreate(name)); project.getExtensions().add(name, extension); project.afterEvaluate(DISPATCHER.toAction(name, sourceSet)); }