diff --git a/CHANGES.md b/CHANGES.md index d4afc67be9e..c98a204f197 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,8 @@ ## Unreleased * Built using Gradle 7.2 * Updated compatibility testing through Gradle 7.2 +* `GenerateAvroProtocolTask` now has a debug log to output its classpath +* `GenerateAvroProtocolTask` will no longer include a debug log to notify that it's using the system classloader if the classpath is empty ## 1.2.1 * Built using Gradle 7.1.1 diff --git a/src/main/java/com/github/davidmc24/gradle/plugin/avro/GenerateAvroProtocolTask.java b/src/main/java/com/github/davidmc24/gradle/plugin/avro/GenerateAvroProtocolTask.java index 7323f82a5f4..fdc84990e36 100644 --- a/src/main/java/com/github/davidmc24/gradle/plugin/avro/GenerateAvroProtocolTask.java +++ b/src/main/java/com/github/davidmc24/gradle/plugin/avro/GenerateAvroProtocolTask.java @@ -108,6 +108,7 @@ private void processIDLFile(File idlFile, ClassLoader loader) { } private ClassLoader assembleClassLoader() { + getLogger().debug("Using classpath: {}", classpath.getFiles()); List urls = new LinkedList<>(); for (File file : classpath) { try { @@ -116,10 +117,6 @@ private ClassLoader assembleClassLoader() { getLogger().debug(e.getMessage()); } } - if (urls.isEmpty()) { - getLogger().debug("No classpath configured; defaulting to system classloader"); - } - return urls.isEmpty() ? ClassLoader.getSystemClassLoader() - : new URLClassLoader(urls.toArray(new URL[0]), ClassLoader.getSystemClassLoader()); + return new URLClassLoader(urls.toArray(new URL[0])); } }