From 426a0d71ff843e28592ab0bbd989aa7fb274976c Mon Sep 17 00:00:00 2001 From: Marcus Ilgner Date: Thu, 5 Oct 2023 15:37:38 +0200 Subject: [PATCH] Write empty extensions descriptor even if no extensions are found --- .../org/pf4j/processor/ExtensionAnnotationProcessor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java b/pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java index 66293f8..582414b 100644 --- a/pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java +++ b/pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java @@ -130,10 +130,10 @@ public class ExtensionAnnotationProcessor extends AbstractProcessor { } } - // write extensions - if (extensions.size() > 0) { - storage.write(extensions); - } + // Even an empty extensions descriptor is semantically correct and should be + // written to prevent classloaders from falling back to extension descriptor + // resources from dependencies of the plugin being processed. + storage.write(extensions); return false; } -- 2.39.5